Build: 26210.2.d15rel
It appears that dotnet restore, msbuild /t:Restore and Visual Studio all produce different versions of the assets files. The difference between dotnet restore and msbuild/Visual Studio is the most alarming because it appears that dependencies changed(this appears to be an out-of-date dotnet). The difference between msbuild /t:Restore and Visual Studio, is causing Visual Studio to kick off unnecessarily design-time builds when you do a command-line restore for every TFM times the number of projects you have. When you have a large project like MVC, this is a lot of wasted cycles and CPU time.
- File -> New Console App (.NET Core)
- Wait for restore
- Rename
obj\project.assets.json to obj\project.assets.json.vs
- Open Visual Studio command prompt
msbuilt /t:Restore [project]
devenv /diff obj\project.assets.json obj\project.assets.json.vs
Expected: For them to be exactly the same
Actual: They are different
Between msbuild /t:Restore and VS differences are the project section:
Visual Studio
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "c:\\users\\davkean\\documents\\visual studio 2017\\Projects\\ConsoleApp189\\ConsoleApp189\\ConsoleApp189.csproj",
"projectName": "ConsoleApp189",
"projectPath": "c:\\users\\davkean\\documents\\visual studio 2017\\Projects\\ConsoleApp189\\ConsoleApp189\\ConsoleApp189.csproj",
"outputPath": "c:\\users\\davkean\\documents\\visual studio 2017\\Projects\\ConsoleApp189\\ConsoleApp189\\obj\\",
"projectStyle": "PackageReference",
"originalTargetFrameworks": [
"netcoreapp1.0"
],
"frameworks": {
"netcoreapp1.0": {
"projectReferences": {}
}
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"target": "Package",
"version": "1.0",
"autoReferenced": true
}
}
}
},
"runtimes": {
"win": {
"#import": []
},
"win-x64": {
"#import": []
},
"win-x86": {
"#import": []
}
}
}
msbuild /t:Restore
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\davkean\\Documents\\visual studio 2017\\Projects\\ConsoleApp189\\ConsoleApp189\\ConsoleApp189.csproj",
"projectName": "ConsoleApp189",
"projectPath": "C:\\Users\\davkean\\Documents\\visual studio 2017\\Projects\\ConsoleApp189\\ConsoleApp189\\ConsoleApp189.csproj",
"outputPath": "C:\\Users\\davkean\\Documents\\visual studio 2017\\Projects\\ConsoleApp189\\ConsoleApp189\\obj\\",
"projectStyle": "PackageReference",
"originalTargetFrameworks": [
"netcoreapp1.0"
],
"files": {
"lib/netcoreapp1.0/ConsoleApp189.dll": "C:\\Users\\davkean\\Documents\\visual studio 2017\\Projects\\ConsoleApp189\\ConsoleApp189\\bin\\placeholder\\netcoreapp1.0\\ConsoleApp189.dll"
},
"frameworks": {
"netcoreapp1.0": {
"projectReferences": {}
}
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"target": "Package",
"version": "1.0"
}
}
}
},
"runtimes": {
"win": {
"#import": []
},
"win-x64": {
"#import": []
},
"win-x86": {
"#import": []
}
}
}
Note the casing of the paths,
Build: 26210.2.d15rel
It appears that
dotnet restore,msbuild /t:Restoreand Visual Studio all produce different versions of the assets files.The difference between dotnet restore and msbuild/Visual Studio is the most alarming because it appears that dependencies changed(this appears to be an out-of-date dotnet). The difference between msbuild /t:Restore and Visual Studio, is causing Visual Studio to kick off unnecessarily design-time builds when you do a command-line restore for every TFM times the number of projects you have. When you have a large project like MVC, this is a lot of wasted cycles and CPU time.obj\project.assets.jsontoobj\project.assets.json.vsmsbuilt /t:Restore [project]devenv /diff obj\project.assets.json obj\project.assets.json.vsExpected: For them to be exactly the same
Actual: They are different
Between msbuild /t:Restore and VS differences are the project section:
Visual Studio
msbuild /t:Restore
Note the casing of the paths,