Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FrameworkReference 'Microsoft.NETCore.App' was not recognized at (264: 5) #3868

Open
rodrigodevelms opened this issue Nov 20, 2019 · 64 comments
Labels
area-setup Issues related to installing .NET Core

Comments

@rodrigodevelms
Copy link

Hi guys.
I am using Debian 10.1, and today I upgraded net core, version 3.0 to 3.0.1 and my application crashed.
Error: "FrameworkReference 'Microsoft.NETCore.App' was not recognized at (264: 5)"

dotnet version :
3.0.101

mono version
Mono JIT compiler version 6.4.0.198 (tarball Tue Sep 24 01:24:35 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(610)
Suspend: hybrid
GC: sgen (concurrent by default)

@dagood
Copy link
Member

dagood commented Nov 20, 2019

How do you acquire .NET Core? The Debian 10 instructions at https://dotnet.microsoft.com/download/linux-package-manager/runtime-current?

Can you post more context around the error, maybe a repro project and steps?

@dagood dagood added the needs-more-info Not enough information has been provided. Please share more detail as requested. label Nov 20, 2019
@dagood
Copy link
Member

dagood commented Nov 21, 2019

I believe @craigjbass hit the same issue and posted more details at #3879 (comment) (many thanks!), copying here because I'm 98% sure it's the same issue and we need to keep track of it:

A few things here @dagood -

  1. I removed dotnet packages entirely to be able to perform a system upgrade.
  2. Went to reinstall dotnet 3.0.0 - so I followed the advice here: CentOS, Fedora, openSUSE, RHEL error "checksum doesn't match" "Package does not match intended download" "Digest verification failed" #3853 (comment)

I think there is something not quite right with the published dependency graph from the dotnet-sdk-3.0 package:

> $ sudo dnf install dotnet-sdk-3.0                                                                                                                                                                                                 ⬡ 10.7.0 
Last metadata expiration check: 0:09:35 ago on Thu 21 Nov 2019 15:38:13 GMT.
Dependencies resolved.
==============================================================================================================================================================================================================================================
 Package                                                              Architecture                                  Version                                          Repository                                                          Size
==============================================================================================================================================================================================================================================
Installing:
 dotnet-sdk-3.0                                                       x86_64                                        3.0.101-1                                        packages-microsoft-com-prod                                         64 M
Installing dependencies:
 aspnetcore-runtime-3.0                                               x86_64                                        3.0.1-1                                          packages-microsoft-com-prod                                        7.5 M
 aspnetcore-targeting-pack-3.0                                        x86_64                                        3.0.1-1                                          packages-microsoft-com-prod                                        1.4 M
 dotnet-apphost-pack-3.0                                              x86_64                                        3.0.1-1                                          packages-microsoft-com-prod                                         66 k
 dotnet-host                                                          x86_64                                        3.0.1-1                                          packages-microsoft-com-prod                                         39 k
 dotnet-hostfxr-3.0                                                   x86_64                                        3.0.1-1                                          packages-microsoft-com-prod                                        147 k
 dotnet-runtime-3.0                                                   x86_64                                        3.0.1-1                                          packages-microsoft-com-prod                                         29 M
 dotnet-runtime-deps-3.0                                              x86_64                                        3.0.1-1                                          packages-microsoft-com-prod                                        2.8 k
 dotnet-targeting-pack-3.0                                            x86_64                                        3.0.1-1                                          packages-microsoft-com-prod                                        3.4 M

Transaction Summary
==============================================================================================================================================================================================================================================
Install  9 Packages

Total download size: 105 M
Installed size: 105 M
Is this ok [y/N]: y

This completed successfully, with the manual install of sudo dnf install -y https://packages.microsoft.com/centos/7/prod/netstandard-targeting-pack-2.1.0-x64.rpm

But I then got this error

15:50	Project 'Frank.EndToEndTests' load finished with warnings: The FrameworkReference 'Microsoft.NETCore.App' was not recognized at (264:5)

Which seemed rather odd.

I then manually installed this package https://packages.microsoft.com/centos/7/prod/dotnet-targeting-pack-3.0.0-x64.rpm

And everything worked!

image

  • I think the dotnet-sdk-3.0 package should have a dependency on dotnet-targeting-pack-3.0.0, unless I'm missing something?
  • It's more than a checksum issue, I think there are some issues with the yum repos

Hmm - just relooking over the dnf transaction output - it does include dotnet-targeting-pack-3.0

image

These are for 3.0.1!

==============================================================================================================================================================================================================================================
 Package                                                               Architecture                                       Version                                              Repository                                                Size
==============================================================================================================================================================================================================================================
Downgrading:
 dotnet-targeting-pack-3.0                                             x86_64                                             3.0.0-1                                              @commandline                                             3.4 M

Transaction Summary
==============================================================================================================================================================================================================================================
Downgrade  1 Package

I think the packages are missing the minor version which is causing major confusion!

Notice that yum is treating this as a downgrade, so I can't target 3.0.1 and 3.0.0 on the same machine. :sadface:

EDIT: dnf repos expect these packages to respect semver. I think we should have dotnet-targeting-pack-3.0.0 and dotnet-targeting-pack-3.0.1 packages published separately so that they can both be installed side-by-side

EDIT EDIT: 🤔 so the alternative here I see is that the 3.0.1-1 is supposed to be backwards compatible, and there's actually a defect in it.

@dagood
Copy link
Member

dagood commented Nov 21, 2019

The root issue here is that dotnet-targeting-pack-3.0-3.0.1 shouldn't have been published at all. 3.0.0 should be the latest. @leecow, can these be removed?

(In future 3.0 patches, this won't be an issue because we won't even build targeting packs we don't intend to release. We didn't have this protection while building 3.0.1. dotnet/core-setup#8827.)


I think we should have dotnet-targeting-pack-3.0.0 and dotnet-targeting-pack-3.0.1 packages published separately so that they can both be installed side-by-side

You should never need a targeting pack from a lower patch version. We include major.minor in the package name so that you can install multiple .NET Core versions side-by-side, but only the latest patch of each one.

This problem should be self-healing if your machine has access to the internet... the SDK will detect that you don't have 3.0.0 installed, download Microsoft.NETCore.App.Ref 3.0.0 from nuget.org to your user directory, and use that. Targeting packs (".Ref") don't roll forward so the version match needs to be exact.

We intend to support offline scenarios so this is something that I believe needs fixing.

@dagood dagood added area-setup Issues related to installing .NET Core and removed needs-more-info Not enough information has been provided. Please share more detail as requested. labels Nov 21, 2019
@dagood
Copy link
Member

dagood commented Nov 21, 2019

@craigjbass taking another look at this, I do think that having dotnet-sdk-3.0-3.0.101 depend on exactly dotnet-targeting-pack-3.0.3.0.0 would be another way to solve this, and would be more robust for other situations too. I opened dotnet/installer#5738 to track and discuss this. (There might be reasons to keep this version "floating" that I forgot or don't know, we'll see there.)

@nguerrera
Copy link
Contributor

I mentioned to @mmitche that we needed to avoid pushing these, but there was a lot of things having to go on for that release.

@nguerrera
Copy link
Contributor

I would still not publish packages that aren't intended to be used, even if sdk were stricter about avoiding them. Which is what we will do moving forward, right:not publish unless they are actually needing a patch?

@dagood
Copy link
Member

dagood commented Nov 21, 2019

I would still not publish packages that aren't intended to be used, even if sdk were stricter about avoiding them. Which is what we will do moving forward, right:not publish unless they are actually needing a patch?

Agreed completely, and yes, we merged dotnet/core-setup#8827 for 3.0.2+ so that we won't even create these packages unless there's a patch.

@rodrigodevelms
Copy link
Author

Thank's all for helping. But something very strange happened.
I installed netcore by adding the repository to debian repo.
I deleted the obj and bin folders and the error continued.
Even creating a new project, the error persisted.
So I decided to restart the laptop, and everything worked. Very strange.

@mtarlac
Copy link

mtarlac commented Nov 22, 2019

Same problem here...

Reinstall doesn't help

dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.0.101
Commit: bc5f8df0f5

Runtime Environment:
OS Name: linuxmint
OS Version: 18.3
OS Platform: Linux
RID: linuxmint.18.3-x64
Base Path: /usr/share/dotnet/sdk/3.0.101/

Host (useful for support):
Version: 3.0.1
Commit: 19942e7199

.NET Core SDKs installed:
3.0.101 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

@dagood
Copy link
Member

dagood commented Nov 22, 2019

Heads up, I think this is still known and expected to be broken at the moment.

It would be helpful if someone could provide a repro project. I'm aware of one scenario that is broken: installing .NET Core SDK, turning off your internet, then trying to build, but that doesn't seem to be what you're hitting in this thread.

@togamid
Copy link

togamid commented Nov 22, 2019

I have pretty much the same setup as @mtarlac (and the same problem). I "fixed" it by downloading the version 3.0.100 binary from microsoft (https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.0.100-linux-x64-binaries) and using that instead of the version 3.0.101 the package manager provides.

@dagood
Copy link
Member

dagood commented Nov 22, 2019

3.0.100 is out of date, if you want to use the tar.gz you should use 3.0.101: https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.0.101-linux-x64-binaries

(--At least until the next patch, 3.0.102, comes around. That's a benefit of using the linux repo, you can use your ordinary repo commands to update unless there's an issue like the one being tracked here.)

@Perustaja
Copy link

Perustaja commented Nov 23, 2019

Sameish issue here on Fedora I think.
When attempting to open a project I get

The "ResolveTargetingPackAssets" task failed unexpectedly.
System.IO.FileNotFoundException: Could not find file "/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/FrameworkList.xml"

When attempting to run any project(new or old with deleted obj/bin directories)

/usr/share/dotnet/sdk/3.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(263,5): error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly. [/home/[...].csproj]

I did also accidentally dotnet run during the installation...not sure if that has anything to do with my old directory sticking around

What fixed it for me:

I "fixed" it by downloading the version 3.0.100 binary from microsoft (https://dotnet.microsoft.com/download/dotnet-core/thank-you/sdk-3.0.100-linux-x64-binaries) and using that instead of the version 3.0.101 the package manager provides.

Using the .gz that dagood referenced. I just copied over and replaced everything. Thanks much, I knew something would break when I saw the upgrading packages..dotnet and Linux don't mix well still. Cheers.

@judep90
Copy link

judep90 commented Nov 23, 2019

@Perustaja - Same issue on Fedora. The specific issue cited is looking for a file provided by dotnet-targeting-pack-3.0-3.0.0-1. After installing that exact version I now end up with a different issue

PS /tmp> New-Item -Type Directory DotnetTest


    Directory: /tmp

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----          11/22/19  6:13 PM                DotnetTest

PS /tmp> cd ./DotnetTest/                   
PS /tmp/DotnetTest> dotnet new console                 
The template "Console Application" was created successfully.

Processing post-creation actions...
Running 'dotnet restore' on /tmp/DotnetTest/DotnetTest.csproj...
  Restore completed in 62.78 ms for /tmp/DotnetTest/DotnetTest.csproj.

Restore succeeded.

PS /tmp/DotnetTest> dotnet build                       
Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  Restore completed in 13.57 ms for /tmp/DotnetTest/DotnetTest.csproj.
/usr/share/dotnet/sdk/3.0.100/Microsoft.Common.CurrentVersion.targets(4563,5): error MSB3030: Could not copy the file "/tmp/DotnetTest/obj/Debug/netcoreapp3.0/DotnetTest" because it was not found. [/tmp/DotnetTest/DotnetTest.csproj]

Build FAILED.

/usr/share/dotnet/sdk/3.0.100/Microsoft.Common.CurrentVersion.targets(4563,5): error MSB3030: Could not copy the file "/tmp/DotnetTest/obj/Debug/netcoreapp3.0/DotnetTest" because it was not found. [/tmp/DotnetTest/DotnetTest.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.69

@nguerrera
Copy link
Contributor

nguerrera commented Nov 23, 2019

In at least one of these cases it looks like the packs/microsoft.netcore.app.ref/3.0.0 directory still exists which is why it isn’t downloading from nuget. But then the files inside it are missing.

@nguerrera
Copy link
Contributor

Cc @dsplaisted

@dagood
Copy link
Member

dagood commented Nov 23, 2019

In at least one of these cases it looks like the packs/microsoft.netcore.app.ref/3.0.0 directory still exists

Oh... I bet it's caused by this bug in our RPM packages: https://github.com/dotnet/core-setup/issues/8235. The targeting pack directory ownership isn't correct, which means uninstalling the 3.0.0 targeting pack (to upgrade to 3.0.1) left the 3.0.0 dir around with no contents. The netcoreapp targeting/apphost packs, netstandard targeting pack, and project template RPMs have this issue.

When we delete the bad dotnet-targeting-pack-3.0-3.0.1 RPMs, this issue will no longer happen when someone performs a new upgrade because dotnet-targeting-pack-3.0-3.0.0 will be the latest version as expected. If we didn't publish the bad dotnet-targeting-pack-3.0-3.0.1, this uninstall issue wouldn't have shown up in this release.

We should fix the ownership issue anyway because leaving this junk around will eventually cause other problems.

@leecow, can you look for and remove any bad targeting packs that are left? I see there's still one on https://packages.microsoft.com/fedora/30/prod/, dotnet-targeting-pack-3.0.1-x64.rpm.


If you're affected by this, you can manually downgrade to the 3.0.0 version to restore the files:

sudo dnf install dotnet-targeting-pack-3.0-3.0.0

Alternatively, you can simply delete the /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0 directory to clean up after the bad uninstall and let the SDK download the targeting pack from nuget.org.

(Once we remove the remaining bad 3.0.1 targeting pack RPMs, a reinstall will also work, but it looks like they still exist on at least one feed.)

@judep90
Copy link

judep90 commented Nov 24, 2019

Alternatively, you can simply delete the /usr/share/packs/Microsoft.NETCore.App.Ref/3.0.0 directory to clean up after the bad uninstall

/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0 for anyone looking for it

@dagood
Copy link
Member

dagood commented Nov 24, 2019

Oops, thanks @judep90, corrected.

@tosha-ret
Copy link

tosha-ret commented Nov 28, 2019

Ubuntu 18.04 Temporary solution:

  1. sudo apt-get remove dotnet-sdk-3.0 (uninstall latest sdk 3.0-3.101-1)
  2. download previous sdk
  3. sudo tar -xvf dotnet-sdk-3.0.100-linux-x64.tar.gz -C /usr/share/dotnet
    (unpack downloaded archive)
  4. reload project

@Nihlus
Copy link

Nihlus commented Nov 28, 2019

An easier workaround for Ubuntu 18.04 is to do the same as for Fedora - downgrade to the working version.

sudo apt install dotnet-targeting-pack-3.0=3.0.0-1

@tosha-ret
Copy link

An easier workaround for Ubuntu 18.04 is to do the same as for Fedora - downgrade to the working version.

sudo apt install dotnet-targeting-pack-3.0=3.0.0-1

Don't work for me, unfortunetly....

My system:
elementary OS 5.0 Juno
Ubuntu 18.04.2 LTS
Linux 4.15.0-70-generic
GTK 3.22.30

SDK for .NET Core (3.0.101)

@valeravorobjev
Copy link

fedora 30 error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly.

@dagood
Copy link
Member

dagood commented Dec 2, 2019

@tosha-ret Can you open a new issue with more info? Full error, sequence of install commands you run to get in that state, output of dotnet --info, other things you can think of? That seems like a different issue since the workaround didn't work, and it deserves its own investigation.

@valeravorobjev Yes, this issue is tracking getting that fixed. Check #3868 (comment) for workarounds that apply to F30.

@Nihlus
Copy link

Nihlus commented Dec 2, 2019 via email

@dagood
Copy link
Member

dagood commented Dec 5, 2019

Thanks, that looks like it'll work great! I do see now that you're hitting the error for Microsoft.AspNetCore.App rather than Microsoft.NETCore.App, but I would expect a common root cause since they're both being upgraded.

The error itself comes from:

ResolveTargetingPackAssets
    Assembly = C:\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk\targets\..\tools\netcoreapp2.1/Microsoft.NET.Build.Tasks.dll
    Parameters
        FrameworkReferences = Microsoft.AspNetCore.App
        GenerateErrorForMissingTargetingPacks = True
    Errors
        C:\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error NETSDK1073: The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized [C:\git\dotnet-build-repro\src\MyProject\MyProject.csproj]
    OutputProperties
        PackageConflictPreferredPackages = 

I believe that normally there should be some ResolvedTargetingPacks item parameters:

<ResolveTargetingPackAssets FrameworkReferences="@(FrameworkReference)"
                            ResolvedTargetingPacks="@(ResolvedTargetingPack)"
                            RuntimeFrameworks="@(RuntimeFramework)"
                            GenerateErrorForMissingTargetingPacks="$(GenerateErrorForMissingTargetingPacks)">
It looks like ProcessFrameworkReferences isn't able to match up the targeting packs you need... I'm not familiar enough with what it expects to know exactly what's going on though. (Click me for the task call details, note the task has no outputs.)
ProcessFrameworkReferences
    Assembly = C:\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk\targets\..\tools\netcoreapp2.1/Microsoft.NET.Build.Tasks.dll
    Parameters
        FrameworkReferences = Microsoft.AspNetCore.App
        KnownFrameworkReferences
            Microsoft.NETCore.App
                DefaultRuntimeFrameworkVersion = 3.1.0
                IsTrimmable = true
                LatestRuntimeFrameworkVersion = 3.1.0
                RuntimeFrameworkName = Microsoft.NETCore.App
                RuntimePackNamePatterns = Microsoft.NETCore.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86
                TargetFramework = netcoreapp3.1
                TargetingPackName = Microsoft.NETCore.App.Ref
                TargetingPackVersion = 3.1.0
            Microsoft.WindowsDesktop.App
                DefaultRuntimeFrameworkVersion = 3.1.0
                IsWindowsOnly = true
                LatestRuntimeFrameworkVersion = 3.1.0
                RuntimeFrameworkName = Microsoft.WindowsDesktop.App
                RuntimePackNamePatterns = Microsoft.WindowsDesktop.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = win-x64;win-x86
                TargetFramework = netcoreapp3.1
                TargetingPackName = Microsoft.WindowsDesktop.App.Ref
                TargetingPackVersion = 3.1.0
            Microsoft.WindowsDesktop.App.WPF
                DefaultRuntimeFrameworkVersion = 3.1.0
                IsWindowsOnly = true
                LatestRuntimeFrameworkVersion = 3.1.0
                Profile = WPF
                RuntimeFrameworkName = Microsoft.WindowsDesktop.App
                RuntimePackNamePatterns = Microsoft.WindowsDesktop.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = win-x64;win-x86
                TargetFramework = netcoreapp3.1
                TargetingPackName = Microsoft.WindowsDesktop.App.Ref
                TargetingPackVersion = 3.1.0
            Microsoft.WindowsDesktop.App.WindowsForms
                DefaultRuntimeFrameworkVersion = 3.1.0
                IsWindowsOnly = true
                LatestRuntimeFrameworkVersion = 3.1.0
                Profile = WindowsForms
                RuntimeFrameworkName = Microsoft.WindowsDesktop.App
                RuntimePackNamePatterns = Microsoft.WindowsDesktop.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = win-x64;win-x86
                TargetFramework = netcoreapp3.1
                TargetingPackName = Microsoft.WindowsDesktop.App.Ref
                TargetingPackVersion = 3.1.0
            Microsoft.AspNetCore.App
                DefaultRuntimeFrameworkVersion = 3.1.0
                LatestRuntimeFrameworkVersion = 3.1.0
                RuntimeFrameworkName = Microsoft.AspNetCore.App
                RuntimePackNamePatterns = Microsoft.AspNetCore.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = win-x64;win-x86;win-arm;osx-x64;linux-musl-x64;linux-musl-arm64;linux-x64;linux-arm;linux-arm64
                TargetFramework = netcoreapp3.1
                TargetingPackName = Microsoft.AspNetCore.App.Ref
                TargetingPackVersion = 3.1.0
            Microsoft.NETCore.App
                DefaultRuntimeFrameworkVersion = 3.0.0
                IsTrimmable = true
                LatestRuntimeFrameworkVersion = 3.0.1
                RuntimeFrameworkName = Microsoft.NETCore.App
                RuntimePackNamePatterns = Microsoft.NETCore.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86
                TargetFramework = netcoreapp3.0
                TargetingPackName = Microsoft.NETCore.App.Ref
                TargetingPackVersion = 3.0.0
            Microsoft.WindowsDesktop.App
                DefaultRuntimeFrameworkVersion = 3.0.0
                IsWindowsOnly = true
                LatestRuntimeFrameworkVersion = 3.0.1
                RuntimeFrameworkName = Microsoft.WindowsDesktop.App
                RuntimePackNamePatterns = Microsoft.WindowsDesktop.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = win-x64;win-x86
                TargetFramework = netcoreapp3.0
                TargetingPackName = Microsoft.WindowsDesktop.App.Ref
                TargetingPackVersion = 3.0.0
            Microsoft.WindowsDesktop.App.WPF
                DefaultRuntimeFrameworkVersion = 3.0.0
                IsWindowsOnly = true
                LatestRuntimeFrameworkVersion = 3.0.1
                Profile = WPF
                RuntimeFrameworkName = Microsoft.WindowsDesktop.App
                RuntimePackNamePatterns = Microsoft.WindowsDesktop.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = win-x64;win-x86
                TargetFramework = netcoreapp3.0
                TargetingPackName = Microsoft.WindowsDesktop.App.Ref
                TargetingPackVersion = 3.0.0
            Microsoft.WindowsDesktop.App.WindowsForms
                DefaultRuntimeFrameworkVersion = 3.0.0
                IsWindowsOnly = true
                LatestRuntimeFrameworkVersion = 3.0.1
                Profile = WindowsForms
                RuntimeFrameworkName = Microsoft.WindowsDesktop.App
                RuntimePackNamePatterns = Microsoft.WindowsDesktop.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = win-x64;win-x86
                TargetFramework = netcoreapp3.0
                TargetingPackName = Microsoft.WindowsDesktop.App.Ref
                TargetingPackVersion = 3.0.0
            Microsoft.AspNetCore.App
                DefaultRuntimeFrameworkVersion = 3.0.0
                LatestRuntimeFrameworkVersion = 3.0.1
                RuntimeFrameworkName = Microsoft.AspNetCore.App
                RuntimePackNamePatterns = Microsoft.AspNetCore.App.Runtime.**RID**
                RuntimePackRuntimeIdentifiers = win-x64;win-x86;win-arm;osx-x64;linux-musl-x64;linux-musl-arm64;linux-x64;linux-arm;linux-arm64
                TargetFramework = netcoreapp3.0
                TargetingPackName = Microsoft.AspNetCore.App.Ref
                TargetingPackVersion = 3.0.1
            NETStandard.Library
                TargetFramework = netstandard2.1
                TargetingPackName = NETStandard.Library.Ref
                TargetingPackVersion = 2.1.0
        TargetFrameworkIdentifier = .NETStandard
        TargetFrameworkVersion = 2.0
        TargetingPackRoot = C:\Program Files\dotnet\packs
        RuntimeGraphPath = C:\Program Files\dotnet\sdk\3.1.100\RuntimeIdentifierGraph.json
        TargetLatestRuntimePatch = False
        TargetLatestRuntimePatchIsDefault = True
        EnableTargetingPackDownload = True
    OutputItems
        _PackageToDownload = 
        RuntimeFramework = 
        TargetingPack = 
        RuntimePack = 
        UnavailableRuntimePack = 

@nguerrera @dsplaisted, can you take a look? What bad/stale state in the project assets file or missing files on disk do you think would cause this to happen?

@bashenk
Copy link

bashenk commented Dec 9, 2019

I arrived at this issue while searching for a resolution to the problem, since I had been receiving the same error upon re-opening a recent project. On a whim, noting that I had .NET Core SDK 3.1.100 installed, I tried changing the TargetFramework to netcoreapp3.1 (from netcoreapp3.0), and it then built successfully.
My config now begins with this

  <PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <LangVersion>latestmajor</LangVersion>

@prcdpr
Copy link

prcdpr commented Dec 9, 2019

I'm also affected by this issue, upgraded from 3.0.0 to 3.1.0 LTS and now it won't compile in Rider.

Reverted back to 3.0.0 and it works.

@dsplaisted
Copy link
Member

@benelliott It looks like in your case you have a project targeting .NET Standard 2.0 that has a FrameworkReference to Microsoft.AspNetCore.App. That's not supported. You need to be targeting .NET Core 3.0 or higher for that FrameworkReference to work.

@pmunshi007
Copy link

pmunshi007 commented Dec 9, 2019

I am facing similar issue. however strange thing is the same setup works on one project and fails on another project. This is really confusing.
I am running this in docker container and base container install dotnet-sdk-3.0 on cent os
Inside container ran below command

> dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.0.101
 Commit:    bc5f8df0f5

Runtime Environment:
 OS Name:     centos
 OS Version:  7
 OS Platform: Linux
 RID:         centos.7-x64
 Base Path:   /usr/share/dotnet/sdk/3.0.101/

Host (useful for support):
  Version: 3.0.1
  Commit:  19942e7199

.NET Core SDKs installed:
  3.0.101 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:

dotnet build on a project throws below error.

/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly. [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: System.IO.FileNotFoundException: Could not find file '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/FrameworkList.xml'. [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: File name: '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/FrameworkList.xml' [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.Xml.XmlTextReaderImpl.FinishInitUriString() [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at System.Xml.Linq.XDocument.Load(String uri) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.AddReferencesFromFrameworkList(String frameworkListPath, String targetingPackDllFolder, ITaskItem targetingPack, List`1 referenceItems) [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.ExecuteCore() [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [abc.csproj]
/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [abc.csproj]
    0 Warning(s)
    1 Error(s)

Strange thing is : we have another project which we also run on the same base dotnet image with above configuration and that project run successfully with out any error. I am not sure why?

I saw few solution where it mentioned to downgrade the version of dotnet SDK. But why for few projects we are facing these error? not all if it is a known issue.

any help would be appreciated.

@mlapaglia
Copy link

In at least one of these cases it looks like the packs/microsoft.netcore.app.ref/3.0.0 directory still exists which is why it isn’t downloading from nuget. But then the files inside it are missing.

Thanks, this worked for me.

image

@pmunshi007
Copy link

pmunshi007 commented Dec 11, 2019

@mlapaglia In my case only 3.0.101 directory exist in microsoft.netcore.app.ref direcrotory and somehow program is looking for 3.0.0 .. How you were having 3.0.0 and 3.0.1 both.

/usr/share/dotnet/sdk/3.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: File name: '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/FrameworkList.xml'

@nguerrera
Copy link
Contributor

It is normal to look for 3.0.0. The ref packs should only increment when there is a genuine bug fix in them. There was a problem where 3.0.1 ref packs were built unnecessarily and pushed to linux package feeds where they get installed, then not used. It gets even worse if the 3.0.0 dir is left behind on an upgrade because that blocks pulling 3.0.0 from nuget.

@dagood Where are we on fixing all the feeds? I would expect we're at the point where reinstalling would fix things. If so, can we provide instructions to get onto a setup with the 3.0.0 pack. I vaguely recall from an issue I had this might require cleaning apt cache, not sure about other linuxes. I am seeing a lot of folks working around the incorrect state still. It would be good to get closure.

@dagood
Copy link
Member

dagood commented Dec 11, 2019

Workarounds for the bad 3.0.1 package are already in the thread:

If you're affected by this, you can manually downgrade to the 3.0.0 version to restore the files:

sudo dnf install dotnet-targeting-pack-3.0-3.0.0

Alternatively, you can simply delete the /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0 directory to clean up after the bad uninstall and let the SDK download the targeting pack from nuget.org.

(Once we remove the remaining bad 3.0.1 targeting pack RPMs, a reinstall will also work, but it looks like they still exist on at least one feed.)

An easier workaround for Ubuntu 18.04 is to do the same as for Fedora - downgrade to the working version.

sudo apt install dotnet-targeting-pack-3.0=3.0.0-1

As for removing the bad targeting packs, I'm still waiting for an update from @leecow. It is still present on https://packages.microsoft.com/fedora/30/prod/, at least, but maybe more. (I don't currently have a tool that scrapes the site but it's looking more and more useful for me to set one up. 😕)

Fixing the RPM-specific issue where uninstalling the targeting pack RPM doesn't remove the 3.0.0 directory is tracked by https://github.com/dotnet/core-setup/issues/8235 as a servicing fix.


Note that this thread also tracks a more complex issue, and I believe this is what people are running into when they see this message on Debian-package-using distros: after uninstalling a targeting pack, it seems some scenarios still assume the files will be present, and fail to build. This apparently happens on Windows too, when VS upgrades from 3.0.0 targeting pack to 3.1.0 targeting pack.

@dsplaisted looked into a binlog we got from a repro, it was apparently a nonsupported scenario: #3868 (comment). From what I see, it sounds like it might be work by coincidence when the targeting packs are installed, but doesn't work with the NuGet fallback path, or something along those lines.

@pmunshi007
Copy link

Thank you @dagood and @nguerrera for your prompt reply and help. Actually, I finally found issue in one of my project. As I mentioned in my earlier comment here that it is strange that with same dotnet version it works with one project but throwing error on another project. Turned out : I was running this applications on docker container and for the application which was throwing error contained yum upgrade command which was upgrading the dotnet version to 3.0.1 and due to that application contained empty /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/ directory and it was throwing error for /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/FrameworkList.xml file not found.
My issue is resolved by removing that yum upgrade command for now. however if the dotnet sdk version get upgraded then it should also point to or look for right path for FrameworkList.xml file.

@boeremak
Copy link

boeremak commented Dec 16, 2019

So I got the same issue after a Visual Studio upgrade, can't build anything anymore from the commandline. Can I just remove: Microsoft .Net Core SDK 3.1.100 (x64) from Visual Studio ( why can't I select the text? ) and it will work again?

I can't seem to uninstall it from the "Programs and Features" list..... I have to use the VS installer.

@nguerrera
Copy link
Contributor

@boeremak can you start a new issue with VS in the title on dotnet/sdk and provide a binlog of a failed build. The simpler the repro project the better, if possible.

There are distinct issues in this thread and I think it will be best to have separate issues.

@boeremak
Copy link

boeremak commented Dec 16, 2019

I have builds failing since today in VS Code, the only update I have done today is the VS update that installs .Net 3.1. it seems that it impact is machine wide.

After doing a dotnet build it seems to also do dotnet msbuilds again..... weird.

`Microsoft Windows [Version 10.0.18362.476]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Dev\repos\solution>dotnet msbuild
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error NETSDK1073: The FrameworkReference 'Microsoft.NETCore.App' was not recognized [C:\Dev\repos\solution\solution.fsproj]
C:\Program Files\dotnet\sdk\3.1.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error NETSDK1073: The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized [C:\Dev\repos\solution\solution.fsproj]

C:\Dev\repos\solution>dotnet build
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

Restore completed in 5,47 sec for C:\Dev\repos\solution\solution.fsproj.
solution -> C:\Dev\repos\solution\bin\Debug\netcoreapp3.0\solution.dll

Build succeeded.
0 Warning(s)
0 Error(s)

Time Elapsed 00:00:10.98
C:\Dev\repos\solution>dotnet msbuild
Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

solution -> C:\Dev\repos\solution\bin\Debug\netcoreapp3.0\solution.dll
`
No clue.

@nguerrera
Copy link
Contributor

Ok, I think I see. The dotnet build would do an implicit dotnet restore, whereas dotnet msbuild would not. Once the restore is done, the dotnet msbuild starts to work.

Am I right in guessing that the project targets netcoreapp3.0 and not netcoreap3.1?

There's an issue with VS 16.3 -> 16.4 upgrades where the 3.0 runtime and targeting pack are uninstalled. The issue will be fixed in future runtime version upgrades. In the meantime, you can get 3.0 runtime and targeting back by running Visual Studio installer and selecting .NET Core 3.0 runtime under Individual Components.

When a targeting pack is not installed, it can be restored from nuget, but for that to work restore has to run. I imagine there are scenarios where IDEs aren't initiating a new restore when the targeting pack is removed. Simply putting it back as above is probably the best bet. Forcing a restore somehow would also work.

(I still think this would have been better on a different issue as it's getting really hard to separate the different threads in this conversation. :()

@boeremak
Copy link

Yes, it targets 3.0 and not 3.1. Well it seems to be the same core issue, doing an upgrade of .Net SDK, even through VS, seems to impact some other parts.

@dagood
Copy link
Member

dagood commented Dec 16, 2019

The root causes of the two issues are unrelated: there's an obvious bug with our RPM package causing problems with upgrade, and some maybe-bug probably due to a bad assumption in VS/Rider/dotnet msbuild. It's just unfortunately not possible to tell which one's being hit from an error message alone.

@mbrautgithub
Copy link

@benelliott It looks like in your case you have a project targeting .NET Standard 2.0 that has a FrameworkReference to Microsoft.AspNetCore.App. That's not supported. You need to be targeting .NET Core 3.0 or higher for that FrameworkReference to work.

@dsplaisted - I am also in the same boat. I am upgrading application from 2.1 to 3.1 and have project using .Net Standard 2.1 which has package reference to
Include="Microsoft.AspNetCore" Version="2.2.0". This package is no more available in .Net core 3.1 and it is absolute. How to resolve this if I need to stay with .Net Standard 2.1 and use Microsoft.AspNetCore latest one. (3.1.0)

@dsplaisted
Copy link
Member

@mbrautgithub ASP.NET 2.x supported both .NET Core and .NET Framework, and thus supported .NET Standard so you could have one DLL that would work on both.

ASP.NET 3.x dropped support for .NET Framework. Given that, why do you need to stay with .NET Standard 2.1? You may be trying to do something that is no longer supported.

@julian-msft
Copy link

I ran into this issue using Rider on Windows. It was caused because my Rider wasn't up to date (was on 2019.1.3). After updating to Rider 2019.3.1, the issue didn't occur anymore.

@Mebus
Copy link

Mebus commented Jan 31, 2020

Similar problem on Fedora 30:

/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018: Unerwarteter Fehler bei der ResolveTargetingPackAssets-Aufgabe. [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018: System.IO.FileNotFoundException: Could not find file '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/FrameworkList.xml'. [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018: File name: '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/FrameworkList.xml' [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.Xml.XmlTextReaderImpl.FinishInitUriString() [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at System.Xml.Linq.XDocument.Load(String uri) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.AddReferencesFromFrameworkList(String frameworkListPath, String targetingPackDllFolder, ITaskItem targetingPack, List`1 referenceItems) [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.ExecuteCore() [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/mebus/something.csproj]
/usr/share/dotnet/sdk/3.1.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(283,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/mebus/something.csproj]

Fehler beim Buildvorgang. Beheben Sie die Buildfehler, und versuchen Sie es anschließend noch mal.
→ rpm -qa | grep dotnet
dotnet-sdk-3.1-3.1.101-1.x86_64
dotnet-targeting-pack-3.1-3.1.0-1.x86_64
dotnet-runtime-deps-3.1-3.1.1-1.x86_64
dotnet-hostfxr-3.1-3.1.1-1.x86_64
dotnet-apphost-pack-3.1-3.1.1-1.x86_64
dotnet-host-3.1.1-1.x86_64
dotnet-runtime-3.1-3.1.1-1.x86_64

.NET core seems to be very unreliable under Linux. Don't want spend time fixing SDK bugs everytime I use it.

Mebus

@osvaldo-github
Copy link

[macOS Catalina] - resolved for me.

This error was reported to me.

I don't wanted downgrade then I tried update all.

First I update my dotnet core to current LTS version (3.1.101) and saw the problem persisted.

After I update my Visual Studio 2019 for Mac (Community) to current version 8.4.5 (build 19) and all problems resolved.

@trajamohan
Copy link

trajamohan commented May 26, 2020

Had faced the same issue after an auto update of dot net core sdk (3.1) to latest version, the issues is the new changes ins sdk is not compatible to monodevelop (7.6) version installed in my system

Switched to visual studio code solved the problem

@lnaie
Copy link

lnaie commented Jun 12, 2020

Right now, I get this with the latest updates and sdks:

/usr/local/share/dotnet/sdk/3.1.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(5,5): Error NETSDK1073: The FrameworkReference 'Microsoft.WindowsDesktop.App.WPF' was not recognized (NETSDK1073) (POC.CLI)

My project is a .net core 3.1 console application that references a Xamarin Forms project.
I noticed this started after switching the Xamarin Android project to target Android v10. However the Xamarin app runs with this compiler error but the console application does not.

OS:

  System Version:	macOS 10.15.5 (19F101)
  Kernel Version:	Darwin 19.5.0

VS details:

Visual Studio Professional 2019 for Mac
Version 8.6.3 (build 30)
Installation UUID: a5968700-7f97-45ff-a6a7-1d063fa23fad
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638)

	Package version: 610000104

Mono Framework MDK
Runtime:
	Mono 6.10.0.104 (2019-12/5d03a6fe116) (64-bit)
	Package version: 610000104

Roslyn (Language Service)
3.6.0-3.20210.9+4eafdcb1bcbd8d3573f2ba6065e56d9b9ce4f8a3

NuGet
Version: 5.6.0.6591

.NET Core SDK
SDK: /usr/local/share/dotnet/sdk/3.1.300/Sdks
SDK Versions:
	3.1.300
	3.1.201
	3.1.200
	3.1.102
	3.1.101
	3.1.100
	3.0.101
	3.0.100
	2.2.207
	2.1.607
	2.1.202
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Sdks

.NET Core Runtime
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	3.1.4
	3.1.3
	3.1.2
	3.1.1
	3.1.0
	3.0.1
	3.0.0
	2.2.8
	2.1.18
	2.1.17
	2.1.16
	2.1.15
	2.1.14
	2.1.13
	2.0.9

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

Updater
Version: 11

Apple Developer Tools
Xcode 11.5 (16139)
Build 11E608c

Xamarin.Mac
Version: 6.18.2.1 (Visual Studio Professional)
Hash: 29c4ea731
Branch: d16-6
Build date: 2020-05-26 17:03:04-0400

Xamarin.iOS
Version: 13.18.2.1 (Visual Studio Professional)
Hash: 29c4ea731
Branch: d16-6
Build date: 2020-05-26 17:03:05-0400

Xamarin Designer
Version: 16.6.0.329
Hash: d4f8bcd13
Branch: remotes/origin/d16-6
Build date: 2020-04-24 02:16:02 UTC

Xamarin.Android
Version: 10.3.1.4 (Visual Studio Professional)
Commit: xamarin-android/d16-6/3a10de9
Android SDK: /Users/lucian/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		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: 29.0.5
SDK Build Tools Version: 28.0.3

Build Information: 
Mono: 165f4b0
Java.Interop: xamarin/java.interop/d16-6@2cab35c
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.31.1@49232bc
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-6@bfb66f3

Microsoft OpenJDK for Mobile
Java SDK: /Users/lucian/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.6.0.50
Hash: 5901879
Branch: remotes/origin/d16-6
Build date: 2020-05-15 00:43:06 UTC

Android Device Manager
Version: 16.6.0.95
Hash: 45d17b5
Branch: remotes/origin/d16-6
Build date: 2020-05-15 00:43:26 UTC

Build Information
Release ID: 806030030
Git revision: f43dfeb8c84a15c535a3a0861dcbc4c68bd73815
Build date: 2020-06-04 12:43:00-04
Build branch: release-8.6
Xamarin extensions: f43dfeb8c84a15c535a3a0861dcbc4c68bd73815

Operating System
Mac OS X 10.15.5
Darwin 19.5.0 Darwin Kernel Version 19.5.0
    Tue May 26 20:41:44 PDT 2020
    root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64

Enabled user installed extensions
.NET Core support for Mono.Debugging 8.0.5
Telerik Xamarin Add-in 2020.1.114

@AndreasErikCoder
Copy link

AndreasErikCoder commented Aug 13, 2020

I'm also getting "Error NETSDK1073: The FrameworkReference 'Microsoft.WindowsDesktop.App.WPF' was not recognized (NETSDK1073)"

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

`

@dsplaisted
Copy link
Member

@PokeArsenalist Building projects that depend on WPF (or Windows Forms) is currently only supported on Windows. So that would be why you see that error only on a Mac.

@AndreasErikCoder
Copy link

@dsplaisted Mine is Xamarin.Forms app. It builds and deploys successfully in devices as well. But the issue I am facing is with the .Net Core app 3.1 unit test project.

@dsplaisted
Copy link
Member

@dsplaisted Mine is Xamarin.Forms app. It builds and deploys successfully in devices as well. But the issue I am facing is with the .Net Core app 3.1 unit test project.

@PokeArsenalist Can you create a separate issue?

@AndreasErikCoder
Copy link

@dsplaisted Opened #5070 to discuss regarding this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-setup Issues related to installing .NET Core
Projects
None yet
Development

No branches or pull requests