Quantcast
Channel: Xamarin.Mac — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 1429

Unable to Generate a Temporary Class in Release Mode

$
0
0

Hi All,
I'm getting a weird error when trying to build a project that references a .NET 2.0 style web service. Here's the situation:

  1. Create a new project. Make it a library to keep things simple.
  2. Right click on the Project > Add > Add Web Reference. Set the framework to ".NET 2.0 Web Services"
  3. Add "http://API.AppDriveForClio.com/V1/UpdateService.asmx" and add the reference.

Here's the problem: When you build the project in debug mode, it works great. When you switch to Release mode, it doesn't build with the following errors:


Building: Test4 (Release) Build started 4/24/2017 8:27:51 PM. __________________________________________________ Project "/Users/tonyvalenti/Projects/Test4/Test4/Test4.csproj" (Build target(s)): Target _DetectSdkLocations: DetectSdkLocations Task XamarinSdkRoot: <null> Target _CoreCompileImageAssets: ACTool Task AppManifest: DeviceModel: <null> DeviceOSVersion: <null> ImageAssets: IntermediateOutputPath: obj/Release/ IsWatchApp: False OptimizePNGs: False OutputPath: bin/Release/ ProjectDir: /Users/tonyvalenti/Projects/Test4/Test4 ResourcePrefix: Resources SdkBinPath: /Applications/Xcode.app/Contents/Developer/usr/bin SdkPlatform: MacOSX SdkVersion: 10.12 Target _CoreCompileInterfaceDefinitions: IBTool Task AppManifest: InterfaceDefinitions: IntermediateOutputPath: obj/Release/ IsWatchApp: False IsWatch2App: False IsAppExtension: False ProjectDir: /Users/tonyvalenti/Projects/Test4/Test4 ResourcePrefix: Resources SdkBinPath: /Applications/Xcode.app/Contents/Developer/usr/bin SdkPlatform: MacOSX SdkRoot: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk SdkVersion: 10.12 BundleResources Output: OutputManifests Output: Target _CoreCompileSceneKitAssets: CompileSceneKitAssets Task IntermediateOutputPath: obj/Release/ ProjectDir: /Users/tonyvalenti/Projects/Test4/Test4 ResourcePrefix: Resources SceneKitAssets: SdkDevPath: /Applications/Xcode.app/Contents/Developer SdkRoot: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk SdkVersion: 10.12 Target _CoreCompileTextureAtlases: TextureAtlas Task AtlasTextures: <null> IntermediateOutputPath: obj/Release/ ProjectDir: /Users/tonyvalenti/Projects/Test4/Test4 ResourcePrefix: Resources SdkBinPath: /Applications/Xcode.app/Contents/Developer/usr/bin SdkDevPath: /Applications/Xcode.app/Contents/Developer SdkUsrPath: /Applications/Xcode.app/Contents/Developer/usr Target _CollectBundleResources: CollectBundleResources Task BundleResources: <null> OptimizePropertyLists: False OptimizePNGs: False ProjectDir: /Users/tonyvalenti/Projects/Test4/Test4 ResourcePrefix: Resources Target _PackLibraryResources: PackLibraryResources Task BundleResourcesWithLogicalNames: <null> Prefix: xammac Target PrepareForBuild: MakeDir Task Directories: bin/Release/ obj/Release/ Target GenerateTargetFrameworkMonikerAttribute: Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files. Target CoreCompile: Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files. Target GenerateSerializationAssemblies: /Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/4.5/sgen.exe /assembly:/Users/tonyvalenti/Projects/Test4/Test4/obj/Release/Test4.dll /proxytypes /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/mscorlib.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.Core.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.Web.Services.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/System.Xml.dll /reference:/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/mono/Xamarin.Mac/Xamarin.Mac.dll Unhandled Exception: System.InvalidOperationException: Unable to generate a temporary class (result=1). SGEN : error CS1703: An assembly `mscorlib' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System.Web.Services' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System.Xml' with the same identity has already been imported. Consider removing one of the references at System.Xml.Serialization.Compiler.Compile (System.Reflection.Assembly parent, System.String ns, System.Xml.Serialization.XmlSerializerCompilerParameters xmlParameters, System.Security.Policy.Evidence evidence) [0x0021a] in <83e9d7a4b42d41219e36aa02cb194cba>:0 at System.Xml.Serialization.TempAssembly.GenerateAssembly (System.Xml.Serialization.XmlMapping[] xmlMappings, System.Type[] types, System.String defaultNamespace, System.Security.Policy.Evidence evidence, System.Xml.Serialization.XmlSerializerCompilerParameters parameters, System.Reflection.Assembly assembly, System.Collections.Hashtable assemblies) [0x004c2] in <83e9d7a4b42d41219e36aa02cb194cba>:0 at System.Xml.Serialization.XmlSerializer.GenerateSerializer (System.Type[] types, System.Xml.Serialization.XmlMapping[] mappings, System.CodeDom.Compiler.CompilerParameters parameters) [0x000cb] in <83e9d7a4b42d41219e36aa02cb194cba>:0 at Driver.Run (System.String[] args) [0x003e5] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0 at Driver.Main (System.String[] args) [0x00005] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Unable to generate a temporary class (result=1). SGEN : error CS1703: An assembly `mscorlib' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System.Web.Services' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System.Xml' with the same identity has already been imported. Consider removing one of the references at System.Xml.Serialization.Compiler.Compile (System.Reflection.Assembly parent, System.String ns, System.Xml.Serialization.XmlSerializerCompilerParameters xmlParameters, System.Security.Policy.Evidence evidence) [0x0021a] in <83e9d7a4b42d41219e36aa02cb194cba>:0 at System.Xml.Serialization.TempAssembly.GenerateAssembly (System.Xml.Serialization.XmlMapping[] xmlMappings, System.Type[] types, System.String defaultNamespace, System.Security.Policy.Evidence evidence, System.Xml.Serialization.XmlSerializerCompilerParameters parameters, System.Reflection.Assembly assembly, System.Collections.Hashtable assemblies) [0x004c2] in <83e9d7a4b42d41219e36aa02cb194cba>:0 at System.Xml.Serialization.XmlSerializer.GenerateSerializer (System.Type[] types, System.Xml.Serialization.XmlMapping[] mappings, System.CodeDom.Compiler.CompilerParameters parameters) [0x000cb] in <83e9d7a4b42d41219e36aa02cb194cba>:0 at Driver.Run (System.String[] args) [0x003e5] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0 at Driver.Main (System.String[] args) [0x00005] in <eeaf85d64a8c4c2eb792db70e13a9f1e>:0 Done building target "GenerateSerializationAssemblies" in project "Test4.csproj" -- FAILED. Target _CleanRecordFileWrites: MakeDir Task Directories: obj/Release/ Done building project "Test4.csproj" -- FAILED. Build FAILED. SGEN : error CS1703: An assembly `mscorlib' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System.Web.Services' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System.Xml' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `mscorlib' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System.Web.Services' with the same identity has already been imported. Consider removing one of the references SGEN : error CS1703: An assembly `System.Xml' with the same identity has already been imported. Consider removing one of the references 0 Warning(s) 8 Error(s) Time Elapsed 00:00:01.44 ---------------------- Done ---------------------- Build: 8 errors, 0 warnings

What is causing this and how can I work around it?


Viewing all articles
Browse latest Browse all 1429

Trending Articles