Bug 6429 - Can't build project with web references in release mode
Summary: Can't build project with web references in release mode
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: MSBuild ()
Version: 4.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-08-06 16:59 UTC by Anton Savin
Modified: 2013-12-05 18:34 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Anton Savin 2012-08-06 16:59:44 UTC
When I add a web reference to a project it fails to build in release mode with the following error:

SGEN : error : Could not load file or assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c4c4237547e4b6cd' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A)
    - Strong name validation failed. (Exception from HRESULT: 0x8013141A)

The error is the same with both Visual Studio and MonoDevelop.
Here is the complete output from Visual Studio with maximum verbosity: https://gist.github.com/3275282
Comment 1 Anton Savin 2012-08-07 05:30:12 UTC
Forgot to say: this bug can be worked around by moving the web reference to a separate library which itself does not reference Mono.
Comment 2 Max Rasguido 2012-08-29 16:03:50 UTC
Can you please give a more explicit explanation of how to workaround this bug? I'm having the exact same issue while releasing an app
Comment 3 Rashmi 2013-01-07 09:00:09 UTC
I got a solution for this issue 

you just have to do is, put the mono.android.dll in to the C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin folder open a command prompt do following steps:
1.cd C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin 
2.sn -Vr Mono.Android.dll
3.gacutil -i C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin 

then build the project.
If you get the error for another dll like System.xml.dll etc. then repeat above procedure for respective dll.

All the best.......!
Comment 4 Peter Collins 2013-05-14 14:21:50 UTC
I am currently unable to reproduce this issue on our stable build of Xamarin Android, although I am not quite clear on the exact reproduction case that results in this error.

Could you please provide a code snippet or attach a small sample project that will reproduce this behavior?
Comment 5 PJ 2013-11-19 17:04:24 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 6 PJ 2013-12-05 18:34:25 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.