I have a program called A. It produces a file, A.exe. A.exe MUST run as a x86 program, and is thus build as one. A.exe refers to B.dll and C.dll.
B.dll and C.dll is set to build as x86 programs to make them available to A.exe
I am fairly new to this building with msbuild.exe so im still learning. I made a buildfile that uses the msbuild task to build my application (A)'s project (.csproj) file. I can easily build ever开发者_StackOverflowything from within Visual Studio.
When i build from my msbuild (commandline) i get this error: "An attempt was made to load an assembly with an incorrect format B.exe.
<Target Name="Compile">
<Message Text="Compiling"/>
<ItemGroup>
<myproject Include="A.csproj"/>
</ItemGroup>
<MSBuild Projects="@(myproject)" Properties="Configuration=Release;Platform=x86"/>
</Target>
There is no need to build the dlls as x86. They should be build for any platform. When they are loaded by a .exe built for x86 the JIT compiler will compile them for the target chosen for the .exe (i.e. x86 if the .exe is built for x86).
Can't help you with msbuild though :-)
精彩评论