sdk: msbuild cannot build new style csproj when targetting net462
From @SidShetye on June 19, 2018 23:48
Steps to reproduce
Problem demo’d at the repo at https://github.com/SidShetye/msbuild-newcsproj-issue
Expected behavior
build the project like VS2017 gui does on the same machine
Actual behavior
build fails even though there are no nuget dependencies
Build FAILED.
"C:\temp\new-old-proj-mix-soln\ClassLibraryFw462NewProj\ClassLibraryFw462NewProj.csproj" (build target) (1) ->
(ResolvePackageAssets target) ->
C:\Program Files\dotnet\sdk\2.1.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error :
Assets file 'C:\temp\new-old-proj-mix-soln\ClassLibraryFw462NewProj\obj\project.assets.json' not found. Run a NuGet package restore
to generate this file. [C:\temp\new-old-proj-mix-soln\ClassLibraryFw462NewProj\ClassLibraryFw462NewProj.csproj]
0 Warning(s)
1 Error(s)
Environment data
msbuild /version
output:
Microsoft (R) Build Engine version 15.7.179.6572 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
15.7.179.6572
OS info: Win 10 x64 v1803 (OS Build 17134.112) VS 2017 (15.7.4)
Copied from original issue: Microsoft/msbuild#3429
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 17 (8 by maintainers)
Commits related to this issue
- fixes dotnet/templating #2347 Added instruction on how to list templates in case template with given name doesn't exist. — committed to GangWang01/sdk by vlada-shubina 4 years ago
- fixes dotnet/templating #2347 Added instruction on how to list templates in case template with given name doesn't exist. — committed to GangWang01/sdk by vlada-shubina 4 years ago
Thanks for the detailed report!
All projects that use
Microsoft.NET.Sdk
require NuGet restore before build. You can accomplish this with a small change to your build script:The VS build does NuGet restore independently and silently, which is why it works transparently.
what are the way to resolve below Issues while Build is going on from VSTS ?? even after ran dotnet build, dotnet restore not able to fix . ??
C:\Program Files\dotnet\sdk\2.1.300\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): Error : Assets file ‘D:\a\3\s\obj\project.assets.json’ not found. Run a NuGet package restore to generate this file.
Process ‘msbuild.exe’ exited with code ‘1’.
I am having same issues on AzureDevOps pipeline after updating my projects to .net core 2.2.
well Finally we were able to resolve the TFS BUILD Issue 🥇 from Command Line and TFS
FROM COMMAND LINE : )
FROM TFS : )
Now we were trying to DEPLOY Asp.Net Core Website after successful BUILD AND RELEASE..
stucked somewhere in Deployment let see…