I need to use RegAsm.exe to register several assemblies in a .bat file; however, since RegAsm.exe is not in the system path, it is difficult to just use like Regsvr32 which is always in the system path. I suppose the reason for this is that there can be multiple .NET Frameworks installed and you need to use the correct one.
You can use the WINDIR enviroment variable to get the root of the path. It will probably be something like:
C:\WINDOWS
You then need to add "\Microsft.NET\Framework\" to the path, and finally the path to the specific .NET Framework you are using:
SET fwpath="%windir%\Microsoft.NET\Framework\v2.0.50727"
%fwpath%\regasm.exe app.dll
This blog is a depository for things I have found regarding VB.NET and C#.NET development (and other things I may need to remember). This blog is primarily for my own reference, but if the information I found is useful to others, then that is great. If others want to contribute with comments or other information, then that is great too.
Tuesday, October 27, 2009
How to pass TARGETDIR with CustomActionData and not get an Error
Maybe it is just me, but it seems like everything I need to do with an MSI setup is never as easy as it should be. Here is just an other example.
I need to pass the Target Directory for the installation to the InstallClass that I am using in the MSI Custom Actions (I have to do this because of other things in the MSI that don't work like they should). However, when I define the CustomActionData as:
/targetPath=[TARGETDIR]
or
/targetPath="[TARGETDIR]"
I get the following error:
Error 1001. Exception occurred while initializing the Installation:System.IO.FileNotFoundException
The solution I have found is to say this:
/targetPath="[TARGETDIR]\"
I found this info from the following post:
http://www.dotnet247.com/247reference/msgs/35/179584.aspx
I later found the Microsoft documentation on solving the problem:
http://msdn.microsoft.com/en-us/library/2w2fhwzz(VS.71).aspx
I need to pass the Target Directory for the installation to the InstallClass that I am using in the MSI Custom Actions (I have to do this because of other things in the MSI that don't work like they should). However, when I define the CustomActionData as:
/targetPath=[TARGETDIR]
or
/targetPath="[TARGETDIR]"
I get the following error:
Error 1001. Exception occurred while initializing the Installation:System.IO.FileNotFoundException
The solution I have found is to say this:
/targetPath="[TARGETDIR]\"
I found this info from the following post:
http://www.dotnet247.com/247reference/msgs/35/179584.aspx
I later found the Microsoft documentation on solving the problem:
http://msdn.microsoft.com/en-us/library/2w2fhwzz(VS.71).aspx
Labels:
CustomActionData,
MSI
Thursday, October 22, 2009
Import an Excel File with VB.NET
Here is a simple solution for importing an Excel file into VB.NET using an OleDbConnection:
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_22487951.html
http://www.experts-exchange.com/Programming/Languages/.NET/Visual_CSharp/Q_22487951.html
Labels:
Excel
Subscribe to:
Posts (Atom)