Thursday, 4 June 2009

Issues with building a project with "Register for COM interop" for a 64-bit assembly

Error message "File is not a valid assembly".

Visual Studio internally uses the 32-bit version of the assembly registration tool (Regasm.exe).
To work around the problem, add a post build command to call the 64-bit version of RegAsm.exe using the following steps.
1. In project properties, select “Build Events…” from the Compile page.
2. Add the following post build command line "%Windir%\Microsoft.NET\Framework64\v2.0.50727\regasm" "$(TargetPath)"

No comments: