MSBUILD: Publish Error

Jan 18, 2011 at 8:41 AM

Hi Mike

I have been able to build and publish without any problems in VS 2010 using MSBuild. Since this morning for reasons unforeseen I am getting the following error:

"ASPNETCOMPILER: error ASPCONFIG: Could not load file or assembly 'mscorcfg' or one of its dependencies. An attempt was made to load a program with an incorrect format."

The strange thing is I can build and publish normally when I take out the step to publish the web application after build. But when I put this back I notice that it builds fine but breaks on compiling at the publishwebsite target.

The publish code is as following:

<Target Name="PublishWebSite" >
  <ConvertToAbsolutePath Paths="$(PublishPath)">
  <Output TaskParameter="AbsolutePaths" PropertyName="PublishPath" />
  <RemoveDir Directories="$(PublishPath)" />
  <AspNetCompiler PhysicalPath="$(WebProjectOutputDir)" VirtualPath="$(PublishPath)" TargetPath="$(PublishPath)" Clean="true" Force="true" />

Can you please provide guidance?


Thanks in advance


Jan 19, 2011 at 10:12 PM

Incorrect format errors are usually issues with mixing 32 and 64 bit code. Have you made any progress on this?