Well I did it all and found that VS2010 has ilasm 4.0, thus making an assembly that is .NET 4.0 targeted. Now I cant reference the assembly from a .NET 3.5 project.
I decided to create a shortcut that executed the older .NET tools i.e. “Visual Studio Command Prompt” 3.5
The two file, vcvarsall.bat and vcvars32.bat, control the way VS cmd prompt sets up the environment and should be copied as follows:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.35.bat
C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.35.bat
@if not "%WindowsSdkDir%" == "" (
@set "PATH=%WindowsSdkDir%bin;%WindowsSdkDir%bin\NETFX 4.0 Tools;%PATH%"
@if exist "%VCINSTALLDIR%VCPackages" set PATH=%VCINSTALLDIR%VCPackages;%PATH% @set PATH=%FrameworkDir%%FrameworkVersion%;%PATH% @set PATH=%FrameworkDir%v2.0.50727;%PATH%
vcvars32.35.bat is modified to place the 3.5 tools first before 4.0.
Note: ilasm before v4.0 is v2.0.50727 so this is placed between the 3.5 and 4.0 versions
i.e. 3.5 then 2.0 then 4.0
…Now just copy the “Visual Studio Command Prompt (2010)” shortcut and replace “vcvarsall.bat” parameter with “vcvarsall.35.bat”
if not exist "%~dp0bin\vcvars32.35.bat" goto missing
call "%~dp0bin\vcvars32.35.bat" goto :eof
vcvarsall.35.bat is only modified to call vcvars32.35.bat NOT the original vcvars32.bat(4.0)
now .NET 2.0 ilasm runs from this new shortcut.