Publish.GacInstall Method
.NET Framework 4
Installs an assembly in the global assembly cache.
Assembly: System.EnterpriseServices (in System.EnterpriseServices.dll)
Parameters
- AssemblyPath
- Type: System.String
The file system path for the assembly.
Implements
IComSoapPublisher.GacInstall(String)| Exception | Condition |
|---|---|
| SecurityException |
A caller in the call chain does not have permission to access unmanaged code. |
-
SecurityPermission
for the ability to access unmanaged code. Associated enumeration: SecurityPermissionFlag.UnmanagedCode
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Error checking
This method throws no exception! ...for anything!
Update (2011/12/13) - After using ILSpy to look at the code for this function, I did discover that errors are sent to the local machine's Event Viewer:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="COM+ SOAP Services" />
<EventID Qualifiers="0">0</EventID>
<Level>3</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2011-12-12T19:40:07.000000000Z" />
<EventRecordID>528445</EventRecordID>
<Channel>Application</Channel>
<Computer>machine name</Computer>
<Security />
</System>
<EventData>
<Data>Installation in the global assembly cache failed: foo</Data>
</EventData>
</Event>
Publish pub = new Publish(); pub.GacInstall("foo");No error, no exception. If the path is valid, and the assembly is strongly named, it will get properly installed in the GAC. Works for target .NET Frame version of assembly. I.e. a .NET Framework 4.0 app using GacInstall will properly install a 3.5 targeted assembly, etc.
Update (2011/12/13) - After using ILSpy to look at the code for this function, I did discover that errors are sent to the local machine's Event Viewer:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="COM+ SOAP Services" />
<EventID Qualifiers="0">0</EventID>
<Level>3</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2011-12-12T19:40:07.000000000Z" />
<EventRecordID>528445</EventRecordID>
<Channel>Application</Channel>
<Computer>machine name</Computer>
<Security />
</System>
<EventData>
<Data>Installation in the global assembly cache failed: foo</Data>
</EventData>
</Event>
- 12/12/2011
- David Hamdan
- 12/13/2011
- David Hamdan