Error building a Release version when referencing a Web Service

1

If I create a New Mono Android application, then change the Active Config of the solution to Release, then right click and choose build, the application builds fine.

If I then add a web reference to http://soatest.parasoft.com/calculator.wsdl as per this tutorial, then if I build again I get the error:

Error 1 Could not load file or assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
C:\Users\Administrator\Documents\Visual Studio 2010\Projects\MonoAndroidApplication3\MonoAndroidApplication3\SGEN

If I change the Active config back to Debug then build, then the solution builds fine. However, I cannot get the Release config to build at all when referencing any web service. This is causing me problems as I can't deploy a release version of my application.

I have tried using VS2010 and MonoDevelop 2.6 Beta 2, both give the same error.

xamarin.android
asked on Stack Overflow Apr 26, 2011 by Matt Hook • edited May 31, 2012 by Greg B

2 Answers

5

I can't figure out why this is happening, but you can workaround it by going to the Build tab of your project properties and turning off "Generate serialization assembly".

answered on Stack Overflow Apr 26, 2011 by jpobst
1

Generate serialization assembly prevented you from building.

I got the NameResolutionFailure when selecting Release target because i didn't set the INTERNET permission in the application's options:

  1. right click your project
  2. select options
  3. select the left item "Mono for Android Application"
  4. set Required Permissions: "INTERNET" by checking the checkmark next to it.

It seems that this is active for debug builds since it's used to connect the debugger to the application.

You have to set this yourself in the Release build configuration.

answered on Stack Overflow May 31, 2012 by EeKay

User contributions licensed under CC BY-SA 3.0