Visual Studio Xamarin - Problem building realease iOS project with webservice

0

I'm experiencing an error when trying to build a release iphone app and I've noticed it has to do with Web Service. It only happens when I add a Web reference.

The target framework is .NET Standard 2.0 and I'm using Visual Studio 2017.

The error is the following:

1>SGEN : error : Não foi possível carregar arquivo ou assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' ou uma de suas dependências. Falha na validação de nome forte. (Exceção de HRESULT: 0x8013141A)

It happens with all the projects I've tested. Has anyone gone through this as well?

I've created a Xamarin Web Forms project and didn't add any code on it, just configured all the info in order to build the app. It worked fine. I've added a Web reference to consume my webservice and it gave me that error when I tried to build the project. Is it a problem with the System.web.service.dll?

ios
visual-studio
web-services
xamarin
asked on Stack Overflow Jul 23, 2019 by tksask • edited Jul 23, 2019 by steveSarsawa

1 Answer

1

System.web.service does not exist for NetStd2, you can not arbitrarily add manual assembly references (especially ones that are based off of the .Net Framework).

You can add a reference to the pre-existing Xamarin.iOS and Xamarin.Android versions within the platform native projects (not .NetStd2 ones).

  • Xamarin.iOS References:

enter image description here

  • Xamarin.Android References:

enter image description here

And then access it from .NetStd2 via a Forms' dependency service:

answered on Stack Overflow Jul 23, 2019 by SushiHangover • edited Jul 23, 2019 by SushiHangover

User contributions licensed under CC BY-SA 3.0