This works fine in VS or through msbuild but not with dotnet restore which is as designed as of now.
@sayedihashimi dotnet restore works only with xproj in current design and will need framework changes to support csproj.
@jainaashish If I understand you correctly, then it is literally impossible to build a combined project.json + csproj solution right now with msbuild and that's as designed? If you read the linked issues, you'll see people are trying to build simple sites that reference a csproj project on a build server and the build is breaking, while working in VS.
This is being fixed by the move of .NET Core projects to use project files, instead of Project.Json.
The first release of that support is in VS 2017 RC, which is now publicly available.
Closing. Please let us know if you see any issues with the support we are shipping in VS 2017 RC.
@rrelyea Trying this VS2017, after a conversion of a xproj to a csproj, there is no packages.config files.
Doing a normal nuget restore on a solution will not restore the dependencies.
You can repro this by creating a new ASP.net Framework web app. Then run what Azure would run:
:: 1. Restore NuGet packages
IF /I "WebApplication2.sln" NEQ "" (
call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\WebApplication2.sln"
IF !ERRORLEVEL! NEQ 0 goto error
)
You'll get
Nothing to do. None of the projects in this solution specify any packages for NuGet to restore.
Then, it won't compile...
NuGet is 3.5
CC @Rick-Anderson
@jsgoupil if you modify what Azure runs to run dotnet restore
instead, does it work?
@blackdwarf
I spent so much time on this... just added 2 more hours and I didn't succeed much. dotnet restore works but it doesn't create the /packages like VS2017 does IF you have a Class Library. (Is it needed though?)
My project GUID is 7B770C35-F561-4221-8A08-E6646CB96DCE. I have noticed that the new Class Library in 2017 have 4DAECC67-F322-4E30-8B4A-A7F6D588ABD5.
There are too many variables that I cannot try them all. It's just not working.
When can I expect this to work on Azure out of the box.
Most helpful comment
@jainaashish If I understand you correctly, then it is literally impossible to build a combined project.json + csproj solution right now with msbuild and that's as designed? If you read the linked issues, you'll see people are trying to build simple sites that reference a csproj project on a build server and the build is breaking, while working in VS.