_From @rainersigwald on June 8, 2017 15:32_
_From @kosa-gyula-77 on June 8, 2017 14:27_
Publishing the _xunitCore1.0_ project in the solution attached from Visual Studio 2017 fails with the following error:
_Assets file 'C:\Users\xxx\Documents\Visual Studio 2017\Projects\xunitCore1.0\xunitCore1.0\obj\project.assets.json' doesn't have a target for '.NETCoreApp,Version=v1.1'. Ensure you have restored this project for TargetFramework='netcoreapp1.1' and RuntimeIdentifier=''._
Could you please help in identifying why I'm getting this error? xunitCore1.0 targets netcoreapp1.0.
Thanks.
_Copied from original issue: Microsoft/msbuild#2196_
_Copied from original issue: dotnet/sdk#1321_
_From @alexvy86 on July 26, 2017 18:14_
@rainersigwald did you figure this out? I'm seeing the same error trying to build a simple console app that targets net451 and netcoreapp1.1
_From @bsivanov on July 27, 2017 11:8_
@alexvy86 Not sure this would help, but I had the same issue when trying to build net40 project after building netstandard2.0 project, and both projects files are in the same folder.
What resolves the issue for me is manually deleting the \obj\project.assets.json file, which tends to break the build for the net40 project, if present, with the following error:
_Your project is not referencing the ".NETFramework,Version=v4.0,Profile=Client" framework. Add a reference to ".NETFramework,Version=v4.0,Profile=Client" in the "frameworks" section of your project.json, and then re-run NuGet restore._
_From @alexvy86 on July 27, 2017 19:26_
Thanks @bsivanov. I did try some variations of that but couldn't get it to work. To be sure I understood correctly: you have 2 separate project files, each one targeting a different framework, correct? For completeness sake in the discussion, in my case there's just one project which multi-targets net451 and netcoreapp1.1.
_From @bsivanov on July 27, 2017 19:44_
@alexvy86 yes, you get me right, but apparently your problem is different. You can maybe try to split the multi-targeting project to two projects, just to check whether the issue is related to some problematic leftover in the project.assets.json. Or maybe try to change the order in <TargetFrameworks>, if it matters at all?
_From @alexvy86 on July 27, 2017 20:41_
I'm trying that as well (separate the projects) and ran into different errors that don't seem related. If I figure this out I'll post an update here.
_From @vullnetyy on August 16, 2017 11:4_
I have a .NET Standard 2.0 project and a .NET Framework 4.6.1 project in the same solution. When I try to build the 4.6.1 project, VS2017 shows the following error: Assets file 'C:\mySolution\dotnetFrameworkProject\obj\project.assets.json' doesn't have a target for '.NETFramework,Version=v4.6.1'. Ensure that restore has run and that you have included 'net461' in the TargetFrameworks for your project.
in
C:\Program Files\dotnet\sdk\2.0.0\Sdks\Microsoft.NET.Sdk\build\Microsoft.PackageDependencyResolution.targets 165
I tried deleting the project.assets.json file but the regenerated file didn't do me any good. I searched the project.assets.json file for the string TargetFrameworks (case insensitive) and only found a key called originalTargetFramework.
Any ideas?
_From @patroza on August 20, 2017 19:39_
Adding <RuntimeIdentifier>win7-x64</RuntimeIdentifier> to the csproj, beneath the <TargetFramework>net462</TargetFramework> seems to work.
(hm this seems to be a fix for another flavour of the same problem :))
_From @Altiss on August 23, 2017 4:14_
I encountered a similar error after updating my solution with multiple 1.1 projects to 2.0. I just deleted the bin and obj folders in each project and rebuilt. I no longer get the error.
_From @RomanKernSW on August 28, 2017 12:39_
@Altiss Thanks, this work for me too
_From @vullnetyy on August 29, 2017 8:51_
Deleting the obj and bin folders did not work for me. However I did manage to fix my issues using
dotnet restore mysolution.sln after getting the latest versions of Visual Studio 2017 and .NET Core 2
_From @kosa-gyula-77 on August 30, 2017 12:25_
The issue cannot be reproduced after updating Visual Studio Professional 2017 to Version 15.3.2.
@rainersigwald, this issue can be closed.
Thanks.
_From @blgrnboy on August 30, 2017 20:33_
@kosa-gyula-77 I disagree, I just ran into this issue on 15.3.2, when trying to upgrade an application from netcoreapp1.1 to netcoreapp2.0. I had to delete the contents of the obj folder.
_From @vullnetyy on August 31, 2017 11:30_
What we've discovered now is that when we have .NET Core SDK 2.0 installed, we cannot build .NET Framework 4.6.1 projects with the new .csproj format. We keep getting the ...obj\project.assets.json... error
_From @patroza on August 31, 2017 13:19_
@vullnetyy does this help? https://github.com/dotnet/sdk/issues/1321#issuecomment-323606946
_From @vullnetyy on September 4, 2017 14:40_
@patroza Do you mean the <RuntimeIdentifier>win7-x64</RuntimeIdentifier>? No. We did try moving to 4.6.2 and placing it beneath TargetFramework and it didn't work anyway. Thanks for trying.
_From @jgauffin on September 23, 2017 12:47_
I get the same error. Also, when updating <targetFrameworks> by changing targets the project.assets.json doesn't seem to sync the changes.
_From @rsbeanbag on September 27, 2017 10:41_
I 'm converting .net framework projects to the 'new' format and stumbled into this very problem. When
I add <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> to the .csproj then my project compiles and runs as expected. 
It's an ugly solution of course but maybe it will help explain why this problem occurs?? (and how to solve this properly)
ps. I have not tried this with a .Net Core project.
_From @pbechtelGitHub on September 28, 2017 18:48_
Changing TargetFramework to TargetFrameworks worked for me for Core 2.0 Console app.
https://stackoverflow.com/questions/42842443/asp-net-core-application-net-framework-for-windows-x64-only-error-in-project
_From @Juslwk on October 6, 2017 14:14_
I encounter this issue when publishing. Weird because I can publish successfully to my development environment, but publishing to production environment fails. Both environments are hosted in Azure as App Services and I am using Azure click-once deployment. I tried changing TargetFramework to TargetFrameworks, and deleted the project.assets.json file without success.
In the end, the way I fix it was, I modified the Development publish profile and changed my connection details to point to the production. After that it publishes successfully.
_From @Judgeja on October 16, 2017 8:49_
I had the same as @Juslwk. I realised my publish profile was still targeting 1.1, even though 2.0 was showing as selected when I went into edit the profile, it showed 1.1 in the publish summary. So I re-selected 2.0 in the dropdown and it updated the summary to show 2.0 and it all worked fine
_From @daveaglick on October 26, 2017 19:6_
This happened to me when I manually edited a csproj file to go from:
<TargetFrameworks>netstandard1.6</TargetFrameworks>
To:
<TargetFrameworks>net46;netstandard1.6</TargetFrameworks>
I tried everything suggested here and the project.assets.json file just kept coming back the same. It wasn't until I closed Visual Studio, deleted the obj folder, and reopened Visual Studio that the restore created a new project.assets.json file with the targeting changes. I suspect the NuGet process in VS must be caching the packages somewhere in memory and won't regenerate the file just for targets changes.
_From @rainymaplesoft on October 30, 2017 17:16_
I got the same problem after I changed the target from net452 to net461, when I ran publish it complained the project was not compatible with net452 etc, even the target framework was set to net461 in the publish profile. BUT, I happened to find the TargetFramwork was still "net452" in the publish summary page, even in the "Setting" it was set to net 461. It was very wired. The solution then became very simple: Delete the publish profile, then create a new one with setting the target framework to that you want. Error is gone.
_From @rainymaplesoft on October 30, 2017 17:20_

_From @ocapio on October 31, 2017 18:14_
@daveaglick I am running into a similar issue since I updated to Visual Studio 2017 15.4.1. It seems like reinstalling Visual Studio seems to fix this. I would like to find a solution to this since other machines may be affected by this.
_From @memark on November 26, 2017 17:2_
I ran into this today, in Visual Studio 15.4.4. I had edited the project file within VS (using right click / Edit) and changed the OutputType.
The solution was to unload/reload the project in VS. It seemed VS did not honour the file change otherwise and instead gave the above error about frameworks.
_From @tameyer1 on December 15, 2017 20:17_
Just ran into this, read through the comments here, and was able to resolve.
I have a core 2.0 library project. I edited the csproj file to add .net45 to targetframeworks. Upon compiling I was getting the Assets file error mentioned above. Tried deleting bin and obj directories and recompiling. This did not work.
Simply did an unload and reload of the project as @memark mentioned. First compile didnt work but I suspect the restore was still running. Once it finished I rebuilt to success. Hope it helps and thanks to the commentators above.
This issue seems to be related to how restore happens in visual studio after project changes. As such, I will move it to NuGet.
This conversation has gone a lot of different directions, so forgive me if I miss a scenario.
I've tested out 2 different scenarios, with the latest 15.6 P2 build.
1) Adding a new target framework in VS.
Expected: Restore happens, targets in the project assets json are updated.
Actual: Restore happens, the targets in the project.assets.json are not updated, however the package spec is updated.
This is definitely a bug.
Hint for later investigation, the originalTargetFrameworks are out of sync with the targetframeworkinformation. 
2) Changing the output type from Exe to Library etc.
Note that "NuGet" does not care directly what the output type is, the difference here is that some of the implied dependencies change in the netcore case when the output is changed. Other things such as a RuntimeIdentifiers are specified in the Exe case as well, which affects restore.
Expected: Restore happens, targets in the project assets json are updated.
Actual: Restore happens, targets in the project assets json are updated.
No repro on this scenario. 
Please let me know if there's a scenario that I've missed, and please provide a repro project and clear repro steps.
//cc
@emgarten 
This seems like it's a nomination issue.
BEGIN Nominate Restore for C:\Users\nikolev.REDMOND\Source\Repos\ConsoleApp21\ConsoleApp21\ConsoleApp21.csproj
    BaseIntermediatePath:     obj\
    OriginalTargetFrameworks: netcoreapp2.0; net461
    Target Frameworks (2)
        net45
            Project References
            Package References
            Target Framework Properties -- (RestoreAdditionalProjectFallbackFolders:;C:\Program Files\dotnet\sdk\2.1.4\Sdks\Microsoft.NET.Sdk\build\..\..\..\..\NuGetFallbackFolder | RestorePackagesPath: | MSBuildProjectDirectory:C:\Users\nikolev.REDMOND\Source\Repos\ConsoleApp21\ConsoleApp21 | RestoreAdditionalProjectSources: | PackageId:ConsoleApp21 | RuntimeIdentifier: | NoWarn:1701;1702;1705 | RestoreAdditionalProjectFallbackFoldersExcludes: | TargetFrameworkIdentifier:.NETFramework | VersionSuffix: | DotnetCliToolTargetFramework:netcoreapp2.0 | VersionPrefix:1.0.0 | BaseIntermediateOutputPath:obj\ | Version:1.0.0 | RestoreFallbackFolders: | MSBuildProjectFile:ConsoleApp21.csproj | TargetFrameworkMoniker:.NETFramework,Version=v4.5 | EmitAssetsLogMessages:true | TargetFramework:net45 | PackageTargetFallback: | TreatWarningsAsErrors:false | TargetFrameworkProfile: | RestoreSources: | TargetFrameworks:netcoreapp2.0; net461 | TargetFrameworkVersion:v4.5 | RuntimeIdentifiers: | PackageVersion:1.0.0 | WarningsAsErrors:NU1605 | AssetTargetFallback:)
        netcoreapp2.0
            Project References
            Package References
                Microsoft.NETCore.App -- (Description: | RuntimeIdentifier: | NoWarn: | OriginalItemSpec: | FrameworkName: | Version:2.0 | Visible: | TargetFramework: | IncludeAssets: | PrivateAssets:All | ExcludeAssets: | IsImplicitlyDefined:true | FrameworkVersion: | Name: | Type: | Path:)
            Target Framework Properties -- (RestoreAdditionalProjectFallbackFolders:;C:\Program Files\dotnet\sdk\2.1.4\Sdks\Microsoft.NET.Sdk\build\..\..\..\..\NuGetFallbackFolder | RestorePackagesPath: | MSBuildProjectDirectory:C:\Users\nikolev.REDMOND\Source\Repos\ConsoleApp21\ConsoleApp21 | RestoreAdditionalProjectSources: | PackageId:ConsoleApp21 | RuntimeIdentifier: | NoWarn:1701;1702;1705 | RestoreAdditionalProjectFallbackFoldersExcludes: | TargetFrameworkIdentifier:.NETCoreApp | VersionSuffix: | DotnetCliToolTargetFramework:netcoreapp2.0 | VersionPrefix:1.0.0 | BaseIntermediateOutputPath:obj\ | Version:1.0.0 | RestoreFallbackFolders: | MSBuildProjectFile:ConsoleApp21.csproj | TargetFrameworkMoniker:.NETCoreApp,Version=v2.0 | EmitAssetsLogMessages:true | TargetFramework:netcoreapp2.0 | PackageTargetFallback: | TreatWarningsAsErrors:false | TargetFrameworkProfile: | RestoreSources: | TargetFrameworks:netcoreapp2.0; net461 | TargetFrameworkVersion:v2.0 | RuntimeIdentifiers: | PackageVersion:1.0.0 | WarningsAsErrors:NU1605 | AssetTargetFallback:;net461)
    Tool References
------------------------------------------
COMPLETED Nominate Restore for C:\Users\nikolev.REDMOND\Source\Repos\ConsoleApp21\ConsoleApp21\ConsoleApp21.csproj
Note that OrignalTargetFrameworks is "net461".
Target Frameworks is net45.
The action that I did was changing ne461 to net45.
//cc
@natidea 
I will add the above investigation in the original SDK issue.
@livarcocc Can you please reopen that one?
Update:
I have the rights to reopen it.