Registering by command, using the Regasm utility
Use: When testing on a different machine and you do not have an installation program
Sometimes you may want to register an assembly for COM interop without building the project; for example, when first testing your component or if you do not have access to the assemblies source code.
In this case, you can use the assembly registration utility Regasm that ships with the .NET Framework Software Development Kit (SDK) or Visual Studio 2005. Regasm will add entries to the registry, which allows a COM (unmanaged) application to consume .NET classes via COM interop.
Machines with either Visual Studio 2005 or the freely available .NET Framework SDK will have this utility installed and other machines may not; therefore. this is not a viable solution for general deployment of your components.
Using the Regasm command line utility
To use the Regasm command line utility:
If the target machine has Visual Studio installed, open the Visual Studio 2005 command prompt (the ordinary command prompt will not have the appropriate environment variables set to use this tool).
If the target machine does not have Visual Studio installed but does have the .NET Framework SDK installed, use the SDK command prompt by choosing Programs, then Microsoft .NET Framework SDK v2.0. If you cannot find it, open a command prompt at the path where Regasm is located. For example, the .NET Framework 2.0 default installation path is C:\Windows\Microsoft.NET\Framework\v2.0.50727.
The following example shows the command used to register the assembly called EditTools with COM. The full path to the assembly should be given unless the current directory of the command prompt is the directory where the assembly is located:
regasm EditTools.dll /codebase
The /codebase parameter is an optional parameter that adds information to the registry specifying the path on disk of the assembly. If the component is not to be deployed to the global assembly cache (GAC), then this option will be required for ArcGIS to find your component successfully; if the component is installed to the GAC, the option is not required. Regasm has many other options; for a full list, type regasm /? or refer to Microsoft Developer Network (MSDN).
Regasm can also be used to unregister assemblies from COM interop, as shown in the following example:
regasm EditTools.dll /unregister
Tuesday, August 14, 2007
Friday, August 10, 2007
Improper installation of .NET Support
Hello All,
I would like to share the ArcGIS application installation error which i have been facing last couple of days and today mornig I end up with the solution.
Problem :
I have written the dll application using ArcGIS 9.2 and C# (Visual Studio 2005) and create the setup for the same. When I tried to install on testing environment, the setup has thrown very common error
"Unable to get installer types in C:\Chirag\..\ABCTools.dll assembly -> Unable to load one or more of the requested types.Retrieve the LoaderExceptions properly for more information."
Answer :
I found the probable reason for such error is "Installation of .NET Support". If you havent installed .NET Support or installed incorrectly then such error may occur.
For correct installation of .NET support, you should have local administrative privileges.If you installed the Microsoft .Net Framework v2.0 prior to installing ArcGIS 9.2 then the ESRI Net support will have been automatically installed.If the Net Framework v2.0 was installed after ArcGIS 9.2 then the following steps have be made to install the ESRI Net support. You can also follow the steps below to validate installation of the ESRI .Net support.
1) Install Microsoft Framework 2.0
2) Display the Add or Remove Programs dialog from the Windows Control Panel (see How to Uninstall above for details),
3) Select ArcGIS Desktop from the list of installed programs
4) Click the Change button to launch the installer. (at this point you may be asked for the source media or access to a network folder that was used to install ArcGIS Desktop)
5) Select Modify and then click Next >. The following dialog will appear listing all the current installed components of ArcGIS 9.2
6) Click on .NET Support and select "Will be installed on local hard"
7) Click Next>
8) At the confirmation prompt click Next > again.
9) As the new files are installed the following progress dialog will appear. If necessary, the installation can be cancelled by clicking the Cancel button, but this is strongly not recommended.
10) Finally click Finish from the installation wizard
Hope it helps !!
I would like to share the ArcGIS application installation error which i have been facing last couple of days and today mornig I end up with the solution.
Problem :
I have written the dll application using ArcGIS 9.2 and C# (Visual Studio 2005) and create the setup for the same. When I tried to install on testing environment, the setup has thrown very common error
"Unable to get installer types in C:\Chirag\..\ABCTools.dll assembly -> Unable to load one or more of the requested types.Retrieve the LoaderExceptions properly for more information."
Answer :
I found the probable reason for such error is "Installation of .NET Support". If you havent installed .NET Support or installed incorrectly then such error may occur.
For correct installation of .NET support, you should have local administrative privileges.If you installed the Microsoft .Net Framework v2.0 prior to installing ArcGIS 9.2 then the ESRI Net support will have been automatically installed.If the Net Framework v2.0 was installed after ArcGIS 9.2 then the following steps have be made to install the ESRI Net support. You can also follow the steps below to validate installation of the ESRI .Net support.
1) Install Microsoft Framework 2.0
2) Display the Add or Remove Programs dialog from the Windows Control Panel (see How to Uninstall above for details),
3) Select ArcGIS Desktop from the list of installed programs
4) Click the Change button to launch the installer. (at this point you may be asked for the source media or access to a network folder that was used to install ArcGIS Desktop)
5) Select Modify and then click Next >. The following dialog will appear listing all the current installed components of ArcGIS 9.2
6) Click on .NET Support and select "Will be installed on local hard"
7) Click Next>
8) At the confirmation prompt click Next > again.
9) As the new files are installed the following progress dialog will appear. If necessary, the installation can be cancelled by clicking the Cancel button, but this is strongly not recommended.
10) Finally click Finish from the installation wizard
Hope it helps !!
Subscribe to:
Posts (Atom)