Solved

installutil partially trusted callers error

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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 you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

623 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