This Question is Not Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
0 Replies Last post: Apr 21, 2013 5:31 AM by William Barnum  
William Barnum Newbie 3 posts since
Apr 21, 2013
Currently Being Moderated

Apr 21, 2013 5:31 AM

BadImageFormatException loading mscorlib.dll ???

I'm not very knowledgeable with TC, but have found myself in charge of an upgrade from v3.1 to v7. Upgrade went well, and most of the build configurations are working just fine, but I have encountered a problem that has me stumped.

 

One of our csproj files is encountering an error (in red, below). The thing is, the .sln builds just fine from Visual Studio AND when I run the the nant script from the command line. But when run via TC, the error occurs.

 

I understand that TC v7 runs its own MSBUILD task for the NAnt runner that is different from NAntContrib, and I've seen that BadImageFormatException before with 32bit vs 64bit confusion, so I think I have a rough idea of what the problem is, but a solition still eludes me.

 

Can anyone help? Thanks,

 

Billy B

 

Oh. This is a 64-bit Window2008R2 box.

 

 

[14:08:58][Build] MSBuild
[14:08:58][MSBuild] src\WeatherService\StrataGen.ADEPT.WeatherCollectionService\StrataGen.ADEPT.Weather.CollectionService.csproj: Build default targets
[14:08:58][src\WeatherService\StrataGen.ADEPT.WeatherCollectionService\StrataGen.ADEPT.Weather.CollectionService.csproj] GetReferenceAssemblyPaths
[14:08:58][GetReferenceAssemblyPaths] GetReferenceAssemblyPaths
[14:08:58][GetReferenceAssemblyPaths] c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(847, 9): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v3.5,Profile=Full" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.
[14:08:58][src\WeatherService\StrataGen.ADEPT.WeatherCollectionService\StrataGen.ADEPT.Weather.CollectionService.csproj] ResolveProjectReferences
[14:08:58][src\WeatherService\StrataGen.ADEPT.WeatherCollectionService\StrataGen.ADEPT.Weather.CollectionService.csproj] ResolveAssemblyReferences
[14:08:58][ResolveAssemblyReferences] ResolveAssemblyReference
[14:08:59][ResolveAssemblyReference] Consider app.config remapping of assembly "mscorlib, Culture=neutral, PublicKeyToken=b77a5c561934e089" from Version "2.0.0.0" [C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll] to Version "4.0.0.0" [c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll] to solve conflict and get rid of warning.
[14:08:59][ResolveAssemblyReference] c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360, 9): warning MSB3247: Found conflicts between different versions of the same dependent assembly.
[14:08:59][src\WeatherService\StrataGen.ADEPT.WeatherCollectionService\StrataGen.ADEPT.Weather.CollectionService.csproj] CoreResGen
[14:08:59][CoreResGen] GenerateResource
[14:08:59][GenerateResource] c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\x64\Tracker.exe @"C:\TeamCity\buildAgent\temp\buildTmp\0d0a6c0efce24cbb87c44d854ce97162.tmp"  /c "c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ResGen.exe" /useSourcePath /r:c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll /r:C:\TCBWork\2e42494e99b4abf0\src\output\StrataGen.ADEPT.Weather.Collector.dll /r:C:\TCBWork\2e42494e99b4abf0\src\output\StrataGen.ADEPT.Weather.Logging.dll /r:C:\Windows\assembly\GAC_MSIL\System.configuration\2.0.0.0__b03f5f7f11d50a3a\System.configuration.dll /r:C:\Windows\assembly\GAC_MSIL\System.Configuration.Install\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.Install.dll /r:C:\Windows\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll /r:C:\Windows\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll /r:C:\Windows\assembly\GAC_32\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll /r:C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll /r:C:\Windows\assembly\GAC_MSIL\System.ServiceProcess\2.0.0.0__b03f5f7f11d50a3a\System.ServiceProcess.dll /r:C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll /r:C:\Windows\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll /compile WeatherService.resx,obj\Release\StrataGen.ADEPT.WeatherCollectionService.WeatherService.resources
[14:08:59][GenerateResource] ResGen error RG0000: Could not load referenced assembly "c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll".  Caught a BadImageFormatException saying "Could not load file or assembly 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.".
[14:08:59][GenerateResource] 1 error(s).
[14:08:59][src\WeatherService\StrataGen.ADEPT.WeatherCollectionService\StrataGen.ADEPT.Weather.CollectionService.csproj] Project src\WeatherService\StrataGen.ADEPT.WeatherCollectionService\StrataGen.ADEPT.Weather.CollectionService.csproj failed.
[14:08:59][src\WeatherService\StrataGen.ADEPT.WeatherCollectionService\StrataGen.ADEPT.Weather.CollectionService.csproj.metaproj] Project src\WeatherService\StrataGen.ADEPT.WeatherCollectionService\StrataGen.ADEPT.Weather.CollectionService.csproj.metaproj failed.

More Like This

  • Retrieving data ...