Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

installutil partially trusted callers error

Posted on 2008-06-23
4
Medium Priority
?
1,632 Views
Last Modified: 2013-12-16
I am a total newbie in .NET and C# so keep this in mind when responding.  I am trying to create a Windows Service and I followed the example on http://www.developer.com/net/csharp/article.php/10918_2173801_1
and when I run installutil I get the error message shown below.  I have run the Visual Studio 2008 Command Prompt in admin mode.  I am using Visual Studio 2008 on Vista Ultimate.  I have searched the internet and a common topic seems to be to add the AllowPartiallyTrustedCallers attribute but I don't know if this is the solution or even how to apply it.  Please help.
Installing assembly 'P:\code\ATO File Copy\ATOfileCopyService\bin\Debug\ATOfileCopyService.exe'.
Affected parameters are:
   logtoconsole = 
   assemblypath = P:\code\ATO File Copy\ATOfileCopyService\bin\Debug\ATOfileCopyService.exe
   logfile = P:\code\ATO File Copy\ATOfileCopyService\bin\Debug\ATOfileCopyService.InstallLog
Unable to create an instance of the ATOfileCopyService.ProjectInstaller installer type.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does not allow partially trusted callers..
Rolling back assembly 'P:\code\ATO File Copy\ATOfileCopyService\bin\Debug\ATOfileCopyService.exe'.
Affected parameters are:
   logtoconsole = 
   assemblypath = P:\code\ATO File Copy\ATOfileCopyService\bin\Debug\ATOfileCopyService.exe
   logfile = P:\code\ATO File Copy\ATOfileCopyService\bin\Debug\ATOfileCopyService.InstallLog
Unable to create an instance of the ATOfileCopyService.ProjectInstaller installer type.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
The inner exception System.Security.SecurityException was thrown with the following error message: That assembly does not allow partially trusted callers..

Open in new window

0
Comment
Question by:ascnd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Alexey_Varlamov
ID: 21846746
Is the P: drive mapped from network share? The network is untrusted storage by default. Copy files to your local drive to have a full trust to this assembly.
0
 

Author Comment

by:ascnd
ID: 21847176
Is there a way to make the P drive trusted?  And, yes it is a mapped network drive.
0
 
LVL 2

Accepted Solution

by:
Alexey_Varlamov earned 2000 total points
ID: 21847530
The detailed description of this solution on the http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx page.

Please use the Control Panel > Administration > Microsoft .NET Framework 2.0 Configuration tool.
Open Runtime Security Policy > Code Groups > Trusted Zone > (Right Mouse Button click) Properties


0
 

Author Comment

by:ascnd
ID: 21848267
Alexey_Varlamov,

The link you provided solved my problem completely.  The other information you provided after that is not completely accurate in your paths and it is also not recommend as it is a security risk according to the website.  Thanks for your help.

For anyone else reading this the blog article refered to above is old and in VS 2008 you can right click on your project and select properities and in the signing tab you can create the key there instead of using the goofy method of using the sn.exe program.  You also don't need to manually add the AssemblyVersionAttribute is suggest either.
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question