Table of Contents [Hide/Show]
Background Explanation Procedure Visual Studio 2005 Visual Basic 6.0
AssemblyInfo.cs
[assembly: ComVisible(true)]
[ComVisible(true), GuidAttribute("my-guid"), InterfaceType(ComInterfaceType.InterfaceIsDual)] public interface IEngine { string HelloWorld(); }
{2D8128D8-8A82-45e5-87CA-6EF158154FEF}
2D8128D8-8A82-45e5-87CA-6EF158154FEF
GuidAttribute
[ComVisible(true), GuidAttribute("my-guid"), ProgId("MyCompany.MyNamespace.MyClassName"), ClassInterface(ClassInterfaceType.None)] public class Engine : IEngine { public string HelloWorld() { return "Hello world"; } }
sn -k "MyCompany.MyNamespace.snk"
SNK
gacutil.exe
GacUtilFolder
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe
C:\Program Files\Microsoft.NET\SDK\v2.0\Bin\gacutil.exe
rem Ensure the install folder exists mkdir "C:\Program Files\MyDeploymentFolder" rem Unregister old version "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe" /u "C:\Program Files\MyDeploymentFolder\MyCompany.MyNamespace.dll" rem Uninstall old version from the GAC "GacUtilFolder\Gacutil.exe" -u "MyCompany.MyNamespace" rem Copy the new version to the install folder COPY MyCompany.MyNamespace.* "C:\Program Files\MyDeploymentFolder\" rem Install the new version to the GAC "GacUtilFolder\Gacutil.exe" -i "C:\Program Files\MyDeploymentFolder\MyCompany.MyNamespace.dll" rem Register the new version "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe" /tlb "MyCompany.MyNamespace.dll"