Solved

installutil partially trusted callers error

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

729 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