dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.74k stars 1.07k forks source link

Error NETSDK1073: The FrameworkReference 'Microsoft.WindowsDesktop.App.WPF' was not recognized (NETSDK1073) #12917

Open AndreasErikCoder opened 4 years ago

AndreasErikCoder commented 4 years ago

Hello all,

I'm getting "Error NETSDK1073: The FrameworkReference 'Microsoft.WindowsDesktop.App.WPF' was not recognized (NETSDK1073)" while trying to run my test project. Mine is a Xamarin.Forms app which builds and deploys successfully in devices. But the issue I am facing is with the .Net Core app 3.1 unit test project. One suggestion that I came across is regarding Rg.Plugins.Popup. My solution structure is: NaySayApp NaySayApp.Android NaySayApp.iOS NaySayApp.Test Except the test project, others has reference to the above mentioned plugin package. Tried to workaround the issue with PrivateAssets/ExcludeAssets but no luck so far.

The same project works fine in my windows Visual Studio, but fails in MAC.

VS Details are as follows:

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

Version 8.7.1 (build 15)
Installation UUID: 151a6da6-b82d-4da3-ad54-29cf873ddcb4
    GTK+ 2.24.23 (Raleigh theme)
    Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

    Package version: 612000090

=== Mono Framework MDK ===

Runtime:
    Mono 6.12.0.90 (2020-02/d3daacdaa80) (64-bit)
    Package version: 612000090

=== Roslyn (Language Service) ===

3.7.0-6.20371.12+917b9dfae12e3b6cb266a3c062fb20a1e9d5fb06

=== NuGet ===

Version: 5.7.0.6702

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.302/Sdks
SDK Version: 3.1.302
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    3.1.6
    2.1.20

=== Xamarin.Profiler ===

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

=== Updater ===

Version: 11

=== Apple Developer Tools ===

Xcode 11.6 (16141)
Build 11E708

=== Xamarin.Mac ===

Xamarin.Mac not installed. Can't find /Library/Frameworks/Xamarin.Mac.framework/Versions/Current/Version.

=== Xamarin.iOS ===

Version: 13.20.2.2 (Visual Studio Community)
Hash: 817b6f72a
Branch: d16-7
Build date: 2020-07-18 18:45:00-0400

=== Xamarin Designer ===

Version: 16.7.0.492
Hash: f5afe667d
Branch: remotes/origin/d16-7-vsmac
Build date: 2020-07-10 18:42:54 UTC

=== Xamarin.Android ===

Version: 11.0.0.3 (Visual Studio Community)
Commit: xamarin-android/d16-7/aca845b
Android SDK: /Users/user/Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 30.0.4
SDK Build Tools Version: 29.0.2

Build Information: 
Mono: 83105ba
Java.Interop: xamarin/java.interop/d16-7@1f3388a
ProGuard: Guardsquare/proguard/proguard6.2.2@ebe9000
SQLite: xamarin/sqlite/3.32.1@1a3276b
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-7@017078f

=== Microsoft OpenJDK for Mobile ===

Java SDK: /Users/user/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: 16.7.0.13
Hash: 8380518
Branch: remotes/origin/dev/jmt/d16-7readconfig~2
Build date: 2020-07-23 22:38:02 UTC

=== Android Device Manager ===

Version: 16.7.0.18
Hash: 4b44bc1
Branch: remotes/origin/d16-7
Build date: 2020-07-23 22:38:26 UTC

=== Build Information ===

Release ID: 807010015
Git revision: b2b8f289ffca8f28c585e9137d193c92462cbf14
Build date: 2020-08-07 10:38:31-04
Build branch: release-8.7
Xamarin extensions: b2b8f289ffca8f28c585e9137d193c92462cbf14

=== Operating System ===

Mac OS X 10.15.6
Darwin 19.6.0 Darwin Kernel Version 19.6.0
    Thu Jun 18 20:49:00 PDT 2020
    root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
tompi commented 3 years ago

Same problem here, very strange... Guess I have to do without unit tests for now :(

BamButz commented 3 years ago
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>

As a temporary workaround, you could add this to your project file.

jdluzen commented 2 years ago

I received this recently too. The workaround worked for compilation, but not runtime. In my case, a dependency was set up to use "bait and switch" style, which did not support Mac. My guess is that it attempted to fallback and use the Windows version, which triggered this error.

EduardoReisDev commented 2 years ago

I'm having the same problem

so far the workaround is working

tnks @BamButz

bpater-tp commented 2 years ago

same here.

Remonell commented 2 years ago

Workaround is not working. When will this get fixed? Any other ideas on how to solve this?

thabot commented 1 year ago
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>

As a temporary workaround, you could add this to your project file.

it working for me