Solved

installutil partially trusted callers error

Posted on 2008-06-23
4
1,591 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
  • 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 500 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now