-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
From @vsfeedback on Mon, 30 Dec 2019 18:27:53 GMT
This issue has been moved from a ticket on Developer Community.
Steps to reproduce:
- Download and extract sample from user (reduced in size)
ErrorSample.zip - Build
- Error:
/Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2126,5): warning MSB3276: Found conflicts between different versions of the same dependent assembly. Please set the "AutoGenerateBindingRedirects" property to true in the project file. For more information, see http://go.microsoft.com/fwlink/?LinkId=294190.
MTOUCH : warning MT0109: The assembly 'System.Security.Cryptography.Pkcs.dll' was loaded from a different path than the provided path (provided path: /Users/donblas/.nuget/packages/system.security.cryptography.pkcs/4.7.0/runtimes/win/lib/netstandard2.1/System.Security.Cryptography.Pkcs.dll, actual path: /Users/donblas/Programming/macios/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/lib/mono/Xamarin.iOS/Facades/System.Security.Cryptography.Pkcs.dll).
MTOUCH : error MT2002: Failed to resolve "System.Security.Cryptography.Pkcs.SignedCms" reference from "System.Security.Cryptography.Pkcs, Version=4.0.3.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Full Log: https://gist.github.com/chamons/53339ab1b25b0ca533b04525a6c62027
When I add the nuget package System.Security.Cryptography.Pkcs version 4.7.0 found here:
https://www.nuget.org/packages/System.Security.Cryptography.Pkcs/
I get the following build error:
Error MT2101: Can't resolve the reference 'System.Security.Cryptography.Pkcs.SignedCms'
I didn’t notice this until I tried to deploy to my phone as it all worked fine on the emulator. However, I’ve found if I turn off Linking it all works - even on my phone. However, this seems dangerous and I’m afraid of issues it could cause down the road.
Original Comments
Stephen Huff on 12/18/2019, 00:20 PM:
BTW this is the full error:
/Users/shuff/Development/shuff_Branch/DocExMobile/DocExMobile.iOS/MTOUCH: Error MT2101: Can't resolve the reference 'System.Security.Cryptography.Pkcs.SignedCms', referenced from the method 'System.Void MsgReader.Outlook.Storage/Message::ProcessSignedContent(System.Byte[])' in 'System.Security.Cryptography.Pkcs, Version=4.0.3.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. (MT2101) (DocExMobile.iOS)
I tried adding the following to "Additional mtouch arguments"
--linkskip=System.Security.Cryptography.Pkcs
but it still errors with "Link Framework SDKs Only" picked. The only work around is "Don't Link"
Visual Studio Feedback System on 12/19/2019, 01:20 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Chris Hamons [MSFT] on 12/23/2019, 04:40 PM:
I have attempted to reproduce your issue in the current stable with:
- New iOS Single View Project
- Add System.Security.Cryptography.Pkcs nuget
- Build Release (Generic Device)
and it builds fine for me.
Please attach a sample project showing the issue.
Stephen Huff on 12/24/2019, 10:45 PM:
I've tried reproducing it in a sample project and have not been able to - is there a way I can privately share the entire project that produces the error with you?
Stephen Huff on 12/24/2019, 11:18 PM:
I got it to error in a test project after all by creating it in the same way and adding all the same references. I originally created my project in Visual Studio 2019 on Windows and then moved it to the Mac - I did the same for this project. I then added all the exact same references but didn't get the error until I added the using statement and created the line:
var signedCms = new SignedCms()
in MainPage.Xaml.cs . That and the using statement are the only differences between what Visual Studio 2019 created in Windows and what I changed on the Mac (other then setting the Debug project to "Link Framework SDKs Only").errorsample.zip
Original Solutions
(no solutions)
Copied from original issue dotnet/macios#7663