Solved

installutil partially trusted callers error

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
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…

911 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

20 Experts available now in Live!

Get 1:1 Help Now