Matt Hook
Matt Hook

Reputation: 11

Error building a Release version when referencing a Web Service

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.

Upvotes: 1

Views: 2843

Answers (2)

EeKay
EeKay

Reputation: 6770

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.

Upvotes: 1

jpobst
jpobst

Reputation: 9982

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".

Upvotes: 5

Related Questions