-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Description
From @frankbuckley on Tue, 24 Sep 2019 15:26:58 GMT
Using version 13.2 and referencing .NET Standard 2.1 class library and annotating with a NotNullAttribute results in error when compiling with linking on.
Steps to Reproduce
- Create .NET Standard class library, choosing .NET Standard 2.1
- Link from iOS project
- Set linking to sdk or all
- Build
Expected Behavior
Project compiles successfully
Actual Behavior
MTOUCH : error MT2101: Can't resolve the reference 'System.Void System.Diagnostics.CodeAnalysis.NotNullAttribute::.ctor()', referenced from the method 'System.Void TestLib.Check::NotNull(System.Object)' in 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Done building target "_CompileToNative" in project "TestApp.csproj" -- FAILED.
Environment
=== Visual Studio Community 2019 for Mac ===
Version 8.3 (build 1805)
Installation UUID: 810f3bf8-337b-43c5-bf8f-395e1eb8f7d6
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 5.16.1.24 (d16-3 / 08809f5b)
Package version: 604000198
=== Mono Framework MDK ===
Runtime:
Mono 6.4.0.198 (2019-06/fe64a4765e6) (64-bit)
Package version: 604000198
=== NuGet ===
Version: 5.3.0.6192
=== .NET Core SDK ===
SDK: /usr/local/share/dotnet/sdk/3.0.100/Sdks
SDK Versions:
3.0.100
3.0.100-rc1-014190
2.2.301
2.2.300
2.1.700
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.4.0/lib/mono/msbuild/Current/bin/Sdks
=== .NET Core Runtime ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
3.0.0
3.0.0-rc1-19456-20
2.2.6
2.2.5
2.1.13
2.1.11
=== Xamarin.Profiler ===
Version: 1.6.12.26
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Updater ===
Version: 11
=== Apple Developer Tools ===
Xcode 11.0 (14936)
Build 11A420a
=== Xamarin.Mac ===
Version: 6.2.0.42 (Visual Studio Community)
Hash: 5e8a208b
Branch: d16-3
Build date: 2019-09-17 14:19:30-0400
=== Xamarin.iOS ===
Version: 13.2.0.42 (Visual Studio Community)
Hash: 5e8a208b
Branch: d16-3
Build date: 2019-09-17 14:19:30-0400
=== Xamarin Designer ===
Version: 16.3.0.230
Hash: bbe518670
Branch: remotes/origin/d16-3-xcode11
Build date: 2019-09-17 18:39:30 UTC
=== Xamarin.Android ===
Version: 10.0.0.43 (Visual Studio Community)
Commit: xamarin-android/d16-3/8af1ca8
Android SDK: /Users/frankbuckley/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.2
SDK Build Tools Version: 28.0.3
Build Information:
Mono: mono/mono/2019-06@7af64d1ebe9
Java.Interop: xamarin/java.interop/d16-3@5836f58
LibZipSharp: grendello/LibZipSharp/d16-3@71f4a94
LibZip: nih-at/libzip/rel-1-5-1@b95cf3f
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.27.1@8212a2d
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-3@cb41333
=== Microsoft Mobile OpenJDK ===
Java SDK: /Users/frankbuckley/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25
1.8.0-25
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Android SDK Manager ===
Version: 1.4.0.65
Hash: c33b107
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:42:44 UTC
=== Android Device Manager ===
Version: 1.2.0.115
Hash: 724ea69
Branch: remotes/origin/d16-3
Build date: 2019-09-19 20:43:06 UTC
=== Xamarin Inspector ===
Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1
=== Build Information ===
Release ID: 803001805
Git revision: df50511ccb08d4d84a53939f1d7fc0b40cbb0ee1
Build date: 2019-09-20 16:10:55+00
Build branch: release-8.3
Xamarin extensions: da8d448cd65f2cc87c5e6dc7e2c2ca7b96d20c72
=== Operating System ===
Mac OS X 10.14.6
Darwin 18.7.0 Darwin Kernel Version 18.7.0
Tue Aug 20 16:57:14 PDT 2019
root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
Build Logs
https://gist.github.com/frankbuckley/359e39d83d3453b5734fb27d8fa110ed#file-log-txt
Example Project (If Possible)
Copied from original issue dotnet/macios#7087