kudu: Deployment fails with new csproj format and 1.0.0-preview3-004056

I have a project I just converted from project.json to csproj. I read the latest issues and tried to set up the environment with a global.json containing:

"sdk": {
    "version": "1.0.0-preview3-004056"
}

I also git clean -xdf’d the repo and deleted deploy.cmd to have a fresh environment. When I deploy packages are restored fine but it seems msbuild isn’t finding them. E.g. my controllers can’t find aspnet’s types:

remote: Generating deployment script.
remote: Running deployment command...
remote: Handling .NET Console Application deployment.
remote: MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin'.
remote: All packages listed in packages.config are already installed.
remote: Controllers\Controller1.cs(1,28): error CS0234: The type or namespace name 'Authorization' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]
remote: Controllers\Controller1.cs(2,28): error CS0234: The type or namespace name 'Http' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]
remote: Controllers\Controller1.cs(3,28): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]
remote: Controllers\Controller1.cs(4,17): error CS0234: The type or namespace name 'EntityFrameworkCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]
remote: Controllers\Controller2.cs(1,28): error CS0234: The type or namespace name 'Authorization' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]
remote: Controllers\Controller2.cs(2,28): error CS0234: The type or namespace name 'Http' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]
remote: Controllers\Controller2.cs(3,28): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]
remote: Controllers\Controller2.cs(4,17): error CS0234: The type or namespace name 'EntityFrameworkCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]
remote: Controllers\Controller3.cs(1,28): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]
remote: Controllers\Controller4.cs(1,28): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'Microsoft.AspNetCore' (are you missing an assembly reference?) [D:\home\site\repository\XXX\XXX.csproj]

The name of my Web App ends with gs and is next to dummy321.

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

@martinnormark, I just tried your repo on my local machine and it worked, your issue is about multiple solution files which has been brought up by @tinchou couple days ago:

I too think that is too constraining. I think the sln path that is specified should be passed on to dotnet restore.

and the fixes are made two days ago: this commit, it’s being reviewed right now

if your project really needs two solution files right now, you can always go back to the custom deploy.cmd: and specify dotnet restore oneOfSeveralSolutionFilePath

That first sample I pointed to was non-VS created. Here is a sample with a VS 2017 RC project: https://github.com/davidebbo-test/MvcCoreVS2017RC