xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.46k stars 512 forks source link

Visual Studio for Mac update leads to "You must add a reference to assembly 'netstandard,...'" #15943

Open terrajobst opened 2 years ago

terrajobst commented 2 years ago

Issue moved from dotnet/standard#1269


From @tstuts on Friday, June 21, 2019 10:08:19 PM

I'm not sure where this issue should be reported, but since it is somewhat related to dotnet/standard#542, I figured I'd start here. This week, some of my team installed the latest updates in Visual Studio for Mac and after doing so they now encounter errors when trying to build. I've created a simple reproduction at https://github.com/tstuts/net-standard-test using a Xamarin.Mac app and a .NET Standard library.


Working Configuration:

Visual Studio: 8.0.9.5
Mono: 5.18.1.3

(Full details in https://github.com/tstuts/net-standard-test/blob/master/WorkingOlderConfig.txt)

Broken Configuration:

Visual Studio: 8.1.1.27
Mono: 5.18.1.28

(Full details in https://github.com/tstuts/net-standard-test/blob/master/BrokenUpdatedConfig.txt) This configuration produces the following error:

Error CS0012: The type 'Guid' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. (CS0012) (NetStandardTestApp)
terrajobst commented 2 years ago

Issue moved from dotnet/standard#1269


From @orryverducci on Monday, July 29, 2019 4:03:02 PM

I'm seeing exactly the same issue, only difference in my case is it's a Xamarin.Mac library referencing a .NET Standard library.

Prior to updating I was able to build the library without any errors, now every reference in the Xamarin.Mac library to an object in the .NET Standard library returns the following error:

Error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. (CS0012)

There's been no changes to the project references or code, and I've tried cleaning all the projects and deleted all the 'obj' and 'bin' folders, but the result is the same.

The newest 8.2 release of Visual Studio for Mac also has the same issue. Here's the full version information from my 'About window:

=== Visual Studio Community 2019 for Mac ===

Version 8.2 (build 1105)
Installation UUID: a045df59-567c-4c86-90f4-4fc9a68d4db1
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 5.14.0.85 (d16-2-fix-mac-updates / 86973979)

    Package version: 600000311

=== Mono Framework MDK ===

Runtime:
    Mono 6.0.0.311 (2019-02/494641b300c) (64-bit)
    Package version: 600000311

=== NuGet ===

Version: 5.1.0.6013

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.2.6
SDK: /usr/local/share/dotnet/sdk/2.2.301/Sdks
SDK Version: 2.2.301
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/msbuild/Current/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 10.3 (14492.2)
Build 10G8

=== Xamarin.Android ===

Version: 9.4.0.51 (Visual Studio Community)
Commit: xamarin-android/d16-2/9fa7775
Android SDK: /Users/Orry/Library/Android/sdk
    Supported Android versions:
        None installed

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.1
SDK Build Tools Version: 29.0.1

Build Information: 
Mono: mono/mono/2019-02@e6f5369c2d2
Java.Interop: xamarin/java.interop/d16-2@d64ada5
LibZipSharp: grendello/LibZipSharp/d16-2@caa0c74
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-2@6f6c969

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/Orry/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 Device Manager ===

Version: 1.2.0.58
Hash: d03e3ea
Branch: remotes/origin/d16-2~1
Build date: 2019-07-16 17:37:14 UTC

=== Xamarin Designer ===

Version: 16.2.0.354
Hash: 5f80a14f8
Branch: remotes/origin/d16-2
Build date: 2019-07-11 17:28:26 UTC

=== Xamarin.Mac ===

Version: 5.14.0.110 (Visual Studio Community)
Hash: a8bcecce
Branch: d16-2
Build date: 2019-06-28 07:31:43-0400

=== Xamarin.iOS ===

Version: 12.14.0.110 (Visual Studio Community)
Hash: a8bcecce
Branch: d16-2
Build date: 2019-06-28 07:31:42-0400

=== 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: 802001105
Git revision: a187f6852ae62ba52b944b47e53702957edfcf7b
Build date: 2019-07-22 18:20:10+00
Build branch: release-8.2
Xamarin extensions: 34bd2378d8d707df25989727c23ce68d9a232a67

=== Operating System ===

Mac OS X 10.14.5
Darwin 18.6.0 Darwin Kernel Version 18.6.0
    Thu Apr 25 23:16:27 PDT 2019
    root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
terrajobst commented 2 years ago

Issue moved from dotnet/standard#1269


From @tstuts on Tuesday, July 30, 2019 12:30:48 AM

@orryverducci Thanks for the report

@wtgodbe Can you or someone else comment on the status of this issue internally?

terrajobst commented 2 years ago

Issue moved from dotnet/standard#1269


From @bskeen on Wednesday, August 11, 2021 4:28:04 AM

This is still an issue. Just tried opening code for a .net standard 2.0 library, and it has tons of compiler errors.

terrajobst commented 2 years ago

Moved from dotnet/standard as this issue has nothing to do with .NET Standard but with Xamarin's implementation of it.

dbnex14 commented 1 year ago

I'm happily out of this garbage ms tech stack