NuGet version (x.x.x.xxx): 4.6.1.5019
dotnet.exe --version (if appropriate): 2.1.102
VS version (if appropriate): 15.6.3
OS version (i.e. win10 v1607 (14393.321)): Windows 10 Build 10.0.16299.309
Worked before? If so, with which NuGet version: Issue after upgrading to VS 15.6.3
Debug application -> all good
Stop application --> all good
Make changes
Debug application --> error:
1>------ Build started: Project: <ProjectName>, Configuration: Debug Any CPU ------
1>C:\Program Files\dotnet\sdk\2.1.102\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets(167,5): error : Assets file 'C:\Users\<UserName>\Documents\GitHub\<Project>\<ProjectName>\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v2.0'. Ensure that restore has run and that you have included 'netcoreapp2.0' in the TargetFrameworks for your project.
1>Done building project "<ProjectName>" -- FAILED.
Rebuild Solution -> all good
Debug application -> all good
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <PlatformTarget>x64</PlatformTarget>
  </PropertyGroup>
  <ItemGroup>
    <Compile Remove="BaseClasses\**" />
    <Compile Remove="Helpers\Controller\**" />
    <EmbeddedResource Remove="BaseClasses\**" />
    <EmbeddedResource Remove="Helpers\Controller\**" />
    <None Remove="BaseClasses\**" />
    <None Remove="Helpers\Controller\**" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
    <PackageReference Include="AgileObjects.ReadableExpressions" Version="1.11.0" />
    <PackageReference Include="Autofac" Version="4.6.2" />
    <PackageReference Include="AutoMapper" Version="6.1.1" />
    <PackageReference Include="FluentValidation" Version="7.5.2" />
    <PackageReference Include="IdentityModel" Version="3.3.0" />
    <PackageReference Include="Sendgrid" Version="9.9.0" />
    <PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
  </ItemGroup>
</Project>
                        I have the same problem when publishing to Azure. Building works perfectly fine. Everything was working fine, one deploy went ok until I made small changes (only in .cs files) and now get this error. New project with same files not working, previous version of app from git also don't work, but previously do. Removing bin, obj folders, clean, restore - I tried everything and still nothing.
My csproj:
``` 
    
    
  
    
  
    
    
    
    
    
    
    
  
    
  
@fabich does this fail for you if you run dotnet build or dotnet publish on your project from the command line?
@nguerrera
@fabich how were you debugging the project you shared above? It is not an application. It does not have the OutputType property set to exe on it.
@fabich does this fail for you if you run dotnet build or dotnet publish on your project from the command line?
No, I only receive an error when pressing F5 in VS or when running unit tests.
After running dotnet build I can run the application or unit tests again without any issues.
Until I do any changes (like deleting an empty folder) and the app won't debug again ...
@fabich how were you debugging the project you shared above? It is not an application. It does not have the OutputType property set to exe on it.
This project is part of a Console Application.
But I most of the time test it with a unit test / integration test project in the same solution.
@fabich can you please set this PROJECTSYSTEM_PROJECTOUTPUTPANEENABLED=1 in developer command prompt and start devenv from there? Then repro your issue, it will print out all the nomination details passed from Project system to NuGet in output window which will help narrow it down.
we are specifically looking for TargetFramework property value being passed
@jainaashish is this what you are looking for?
https://gist.github.com/fabich/ef49fb11e90b18b2e1e3492df9e07379
Thanks for sharing that! This looks right.
Can you share a sample repro solution to further analyze this issue?
And btw what is the failing project name in that log file you shared? and do you see BEGIN Nominate Restore for <project name> in that log?
I fixed my problem with publishing to Azure by removing "C:\Program Files\dotnet\sdk\2.1.102" folder and having only "2.1.101". Solution provided from StackOverflow
@Zorzin it looks like this solved my problem as well, thanks!
And btw what is the failing project name in that log file you shared? and do you see BEGIN Nominate Restore for
in that log? 
It's not always the same. Sometimes it's BI, sometimes CMN, sometimes others.
Yes, they are all in that log.
@fabich do you have ReSharper installed? A lot of ppl seem to be hitting an issue with conflicting NuGet assemblies in VS and ReSharper.
@dasMulli yes I have
See https://github.com/dotnet/sdk/issues/2068#issuecomment-374868287
We've figured out the issue internally; an assembly resolver in the R# extension is incorrectly resolving one of our assemblies to one of their assemblies. This only occurs when .NET Core SDK 2.1.102 is installed, which comes with 15.6.3.
We're working on a patch will be released in the next couple of days that will avoid R#'s assembly resolver to be called, and we're going to be working with R# to resolve the underlying issue.
The problem is fixed in ReSharper 2017.3.5, everything works with all combinations of Visual Studio and .NET Core SDK.
You can find more technical details in the official blog post: https://blog.jetbrains.com/dotnet/2018/03/23/build-failures-visual-studio-15-6-3-resharper-ultimate-2017-3-5-rescue/
Thanks! We also released VS 15.6.4 with a different version of nuget in sdk that manages to get around the issue.
@nguerrera, it's great that VS 15.6.4 is released, but it doesn't solve the problem in general case. E.g., if you use a specific version of .NET Core SDK (e.g., via global.json), you still have this problem.
Yes. Absolutely right. I just wanted to add a related note.
Get Outlook for iOShttps://aka.ms/o0ukef
From: Andrey Akinshin notifications@github.com
Sent: Friday, March 23, 2018 4:13:00 PM
To: NuGet/Home
Cc: Nick Guerrera; Mention
Subject: Re: [NuGet/Home] project.assets.json doesn't have a target for .NETCoreApp,Version=v2.0 (#6710)
@nguerrera, it's great that VS 15.6.4 is released, but it doesn't solve the problem in general case. E.g., if you use a specific version of .NET Core SDK (e.g., via global.json), you still have this problem.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FNuGet%2FHome%2Fissues%2F6710%23issuecomment-375822061&data=04%7C01%7CNick.Guerrera%40microsoft.com%7C7372a5c9d75943ae262308d591139fb9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636574435825657523%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=IIXyI%2BLFueKAeRBbsYeW0q5weX0vjYZYZNtrsb033IE%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAEmzl9WyTU1DQaQ8f5NLc4ANVu24x0mks5thYF8gaJpZM4Sx8vv&data=04%7C01%7CNick.Guerrera%40microsoft.com%7C7372a5c9d75943ae262308d591139fb9%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636574435825667523%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=AGKkiM4N2du5MiwzG3zuGPZK3HQoCl7s7iH0fKy%2BqYA%3D&reserved=0.
Just closing the loop here.
This has been resolved. 
I had the same problem. I install dotnet sdk and runtime again. and use this code in cmd "dotnet F:\nikosa_both\nikosaBoth\nikosaBoth\bin\Debug\netcoreapp2.1\nikosaBoth.dll" and then I found my problem. I deleted package that have problem from csproj . and now it work again
@nguerrera I'm not sure this has been resolved, I just encountered this problem with VS 15.7.5 after changing the .NET Core target from 2.0 to 2.1. I had to delete and reinstall the .NET Core SDK to get around the issue.
This error can trigger in different cases and could be unrelated to the root cause of the incident this issue tracked. Please open a new bug with repro steps if you encounter the message.
Most helpful comment
No, I only receive an error when pressing F5 in VS or when running unit tests.
After running
dotnet buildI can run the application or unit tests again without any issues.Until I do any changes (like deleting an empty folder) and the app won't debug again ...
This project is part of a Console Application.
But I most of the time test it with a unit test / integration test project in the same solution.