N S

Novick Software Management • Design • Programming • Training • Consulting

   

 

 

Tips and Tricks for:  VB.Net, C#

The Problem:   How do you get an strong name for the Web Browser Control?

All the assemblies referenced by a strongly named assembly must also be strongly named.  This happens when using the Updater Application Block (UAB) from Microsoft and in other circumstances.  That presents a problem when using the Microsoft Web Browser control (shdocvw) on a Visual Studio WinForm because the Interop assembly created by Visual Studio doesn't have a strong name. 


Solution: Use AXIMP to create an Interop assembly with a strong name.

The command line utility AXIMP, included with Visual Studio, makes a strongly named assembly.  There is similar tip about creating strongly named interop assemblies for other COM DLLs using the TLIMP.EXE

Here's the text of a single line .CMD file that uses aximp to create two assemblies: ShDocVwdll and AxShDocVw.dll.  The line is split over several lines for readability. To create the latter, it must write a C# module AxShDocVw.cs.   .

""c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\aximp.exe " 
                  /keyfile:MyKeyFile.snk 
                  /source 
                   c:\windows\system32\shdocvw.dll

I've included the command line in a .CMD file and also the output files in a zip, which you can download here.     They were made on a Windows XP system with Service Pack 1, .Net framework 1.1, and Internet Explorer 6.  I'm under the impression that all versions of IE 6 will produce the same Interop assembly.


RSS as HTML

Personal Blog

 
New Tips:

Loading SQL Profiler trace (.trc) files with fn_trace_gettrace

Upcoming
Presentations:

Big Data:
Working with Terabytes
in SQL Server

July 9 '08


Full Schedule