Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - PSSnapIn InstallUtil Problem -- "That assembly does not allow partially trusted callers.."

Reply
 
Old 07-27-2006   #1 (permalink)
Alan Taylor


 
 

PSSnapIn InstallUtil Problem -- "That assembly does not allow partially trusted callers.."

I'm trying to create my first PSSnapIn. However, I'm getting "That assembly
does not allow partially trusted callers.." when attempting an installutil
on the compiled DLL.

I'm going for the minimalist approach and not using Visual Studio to
generate "AssemblyInfo.cs" or csproj files. Is that what is messing me up?
Is there a way to use another editor to create the cmdlet and snapin CS
files then just compile and install them?

Please pardon my C# workflow ignorance.

Thanks,
Alan


PS C:\> &$compiler /target:library /r:$ref bar.cs |
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe -i bar.dll
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.


Running a transacted installation.

Beginning the Install phase of the installation.
See the contents of the log file for the C:\bar.dll assembly's progress.
The file is located at C:\bar.InstallLog.
Installing assembly 'C:\bar.dll'.
Affected parameters are:
logtoconsole =
assemblypath = C:\bar.dll
i =
logfile = C:\bar.InstallLog
Unable to create an instance of the foo.SnapIn 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..

An exception occurred during the Install phase.
System.InvalidOperationException: Unable to create an instance of the
foo.SnapIn installer type.
The inner exception System.Reflection.TargetInvocationException was thrown
with the following error message: 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..

The Rollback phase of the installation is beginning.
See the contents of the log file for the C:\bar.dll assembly's progress.
The file is located at C:\bar.InstallLog.
Rolling back assembly 'C:\bar.dll'.
Affected parameters are:
logtoconsole =
assemblypath = C:\bar.dll
i =
logfile = C:\bar.InstallLog
Unable to create an instance of the foo.SnapIn 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..
An exception occurred during the Rollback phase of the
System.Configuration.Install.AssemblyInstaller installer.
System.InvalidOperationException: Unable to create an instance of the
foo.SnapIn installer type.
The inner exception System.Reflection.TargetInvocationException was thrown
with the following error message: 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..
An exception occurred during the Rollback phase of the installation. This
exception will be ignored and the rollback will continue. However, the
machine might not fully revert to its initial state after the rollback is
complete.

The Rollback phase completed successfully.

The transacted install has completed.
The installation failed, and the rollback has been performed.



My System SpecsSystem Spec
Old 07-28-2006   #2 (permalink)
Alan Taylor


 
 

Re: PSSnapIn InstallUtil Problem -- "That assembly does not allow partially trusted callers.."

Just to complete the loop, I found the following article on the PowerShell
Team Blog:

"The worlds easiest way to create/install MshSnapins"
http://blogs.msdn.com/powershell/arc...25/583258.aspx

With a few obvious changes the script works with Powershell and you don't
have to do the SnapIn code.

Alan


"Alan Taylor" <alan DOT ML @T geemail D_OT com> wrote in message
news:OLINBjZsGHA.4608@TK2MSFTNGP04.phx.gbl...
> I'm trying to create my first PSSnapIn. However, I'm getting "That

assembly
> does not allow partially trusted callers.." when attempting an installutil
> on the compiled DLL.
>
> I'm going for the minimalist approach and not using Visual Studio to
> generate "AssemblyInfo.cs" or csproj files. Is that what is messing me

up?
> Is there a way to use another editor to create the cmdlet and snapin CS
> files then just compile and install them?
>
> Please pardon my C# workflow ignorance.
>
> Thanks,
> Alan
>
>
> PS C:\> &$compiler /target:library /r:$ref bar.cs |
> C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe -i bar.dll
> Microsoft (R) .NET Framework Installation utility Version 2.0.50727.42
> Copyright (c) Microsoft Corporation. All rights reserved.
>
>
> Running a transacted installation.
>
> Beginning the Install phase of the installation.
> See the contents of the log file for the C:\bar.dll assembly's progress.
> The file is located at C:\bar.InstallLog.
> Installing assembly 'C:\bar.dll'.
> Affected parameters are:
> logtoconsole =
> assemblypath = C:\bar.dll
> i =
> logfile = C:\bar.InstallLog
> Unable to create an instance of the foo.SnapIn 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..
>
> An exception occurred during the Install phase.
> System.InvalidOperationException: Unable to create an instance of the
> foo.SnapIn installer type.
> The inner exception System.Reflection.TargetInvocationException was thrown
> with the following error message: 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..
>
> The Rollback phase of the installation is beginning.
> See the contents of the log file for the C:\bar.dll assembly's progress.
> The file is located at C:\bar.InstallLog.
> Rolling back assembly 'C:\bar.dll'.
> Affected parameters are:
> logtoconsole =
> assemblypath = C:\bar.dll
> i =
> logfile = C:\bar.InstallLog
> Unable to create an instance of the foo.SnapIn 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..
> An exception occurred during the Rollback phase of the
> System.Configuration.Install.AssemblyInstaller installer.
> System.InvalidOperationException: Unable to create an instance of the
> foo.SnapIn installer type.
> The inner exception System.Reflection.TargetInvocationException was thrown
> with the following error message: 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..
> An exception occurred during the Rollback phase of the installation. This
> exception will be ignored and the rollback will continue. However, the
> machine might not fully revert to its initial state after the rollback is
> complete.
>
> The Rollback phase completed successfully.
>
> The transacted install has completed.
> The installation failed, and the rollback has been performed.
>
>



My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Problems with the "Require trusted path for credential entry" setting Vista security
Missing "Dependant Assembly Microsoft.VC80.MFCLOC" Vista performance & maintenance
How to change "require trusted path for credential entry" Vista account administration
SOME "NEW CONTACTS" ISSUEs PARTIALLY RESOLVED Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46