projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 653 forks source link

Support for ASP.NET Core 1.0 #2083

Closed SebastianStehle closed 5 months ago

SebastianStehle commented 8 years ago

Hi, does the git publishing in azure support dotnet.core 1.0?

GETSDKTOOLINGINFO : error : The project is configured to use .NET Core SDK version 1.0.0- which is not installed or cannot be found under the path D:\Program Files (x86)\dotnet. These components are required to build and run this project. Download the version of .NET Core SDK specified in global.json or update the SDK version in global.json to the version that is installed.

My global.json:

{ "projects": [ "src", "test" ], "sdk": { "version": "1.0.0-" } }

SebastianStehle commented 8 years ago

I just recognized that it works if I run dotnet publish in kudu ... probably an issue with msbuild

ealsur commented 8 years ago

Try restarting your Azure Web App. I found out that migrating from existing RC2 projects sometimes it would not work unless I restarted the app.

ahmelsayed commented 8 years ago

ASP.NET Core 1.0 should be fully supported for git deployments. If you have a consistent repro, can you share a repo that produces that error?

SebastianStehle commented 8 years ago

I have a added you to my repo @ahmelsayed ... is this okay?

ahmelsayed commented 8 years ago

Thanks @SebastianStehle I just gave your repo a try, basically:

I got npm errors, but not the error you have above. npm errors were about installing canvas, though I get the same error (below) on my desktop running npm i canvas. Do you know if it supports windows?

Warning: Missing input files:
C:\GTK\bin\zlib1.dll
C:\GTK\bin\libexpat-1.dll
C:\GTK\bin\libpng14-14.dll
C:\GTK\bin\libcairo-2.dll
C:\GTK\bin\libfontconfig-1.dll
C:\GTK\bin\libfreetype-6.dll
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  Canvas.cc
  CanvasGradient.cc
  CanvasPattern.cc
  CanvasRenderingContext2d.cc
  color.cc
  Image.cc
  ImageData.cc
  init.cc
d:\temp\lll\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\ init.cc) [D:\temp\lll\node_modules\canvas\build\canvas.vcxproj]
d:\temp\lll\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\ Image.cc) [D:\temp\lll\node_modules\canvas\build\canvas.vcxproj]
d:\temp\lll\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\ CanvasPattern.cc) [D:\temp\lll\node_modules\canvas\build\canvas.vcxproj]
d:\temp\lll\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\ CanvasGradient.cc) [D:\temp\lll\node_modules\canvas\build\canvas.vcxproj]
d:\temp\lll\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\ Canvas.cc) [D:\temp\lll\node_modules\canvas\build\canvas.vcxproj]
d:\temp\lll\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\ ImageData.cc) [D:\temp\lll\node_modules\canvas\build\canvas.vcxproj]
d:\temp\lll\node_modules\canvas\src\Canvas.h(19): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory (compiling source file ..\src\ CanvasRenderingContext2d.cc) [D:\temp\lll\node_modules\canvas\build\canvas.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `msbuild` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\ahmels\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Windows_NT 10.0.14390
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ahmels\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\temp\lll\node_modules\canvas
gyp ERR! node -v v6.2.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'D:\temp\lll\package.json'
npm WARN lll No description
npm WARN lll No repository field.
npm WARN lll No README data
npm WARN lll No license field.
npm ERR! Windows_NT 10.0.14390
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ahmels\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i" "canvas"
npm ERR! node v6.2.0
npm ERR! npm  v3.9.5
npm ERR! code ELIFECYCLE

npm ERR! canvas@1.4.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.4.0 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs canvas
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls canvas
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\temp\lll\npm-debug.log
ahmelsayed commented 8 years ago

though by the way the deployment seems to have finished successfully and the published site works, though some broken components (missing css or js or something) which might be related to npm crapping out

SebastianStehle commented 8 years ago

Very strange. You can ignore the npm errors. Perhaps I need to restart my web app or start with a new instance.

ellern commented 8 years ago

I'm running into a error while trying to git deploy .net core 1.0.0 mvc app that targets net46 and references a regular .NET 4.6 .csproj project.

Here is the activity log from the failed deployment:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment.
MSBuild auto-detection: using msbuild version '14.0' from 'D:\Program Files (x86)\MSBuild\14.0\bin'.
All packages listed in packages.config are already installed.
Restoring packages for D:\home\site\repository\src\Test.Web\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in D:\home\site\repository\src\Test.Web\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in D:\home\site\repository\src\Test.Web\project.json...
WARNING: Detected package downgrade: Microsoft.AspNetCore.Mvc from 0.0.0 to 1.0.0 
 Test.Web (>= 1.0.0) -> FluentValidation.AspNetCore (>= 6.4.0-beta3) -> Microsoft.AspNetCore.Mvc  
 Test.Web (>= 1.0.0) -> Microsoft.AspNetCore.Mvc (>= 1.0.0)
Committing restore...
Lock file has not changed. Skipping lock file write. Path: D:\home\site\repository\src\Test.Web\project.lock.json
D:\home\site\repository\src\Test.Web\Test.Web.xproj
Restore completed in 4629ms.

NuGet Config files used:
    C:\DWASFiles\Sites\#test-dev-web\AppData\NuGet\NuGet.Config

Feeds used:
    https://api.nuget.org/v3/index.json
Lock file Microsoft.DotNet.ProjectModel.Graph.LockFile contains msbuild projects but there is no export file
Failed exitCode=1, command=dotnet publish "D:\home\site\repository\src\Test.Web" --output "D:\local\Temp\8d3cc502b48e58b" --configuration Release
An error has occurred during web site deployment.
Lock file Microsoft.DotNet.ProjectModel.Graph.LockFile contains msbuild projects but there is no export file\r\nD:\Program Files (x86)\SiteExtensions\Kudu\57.50815.2378\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd"

My project.json file:

{
  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true,
    "compile": {
      "exclude": [
        "assets",
        "bower_components",
        "node_modules",
        "typings"
      ]
    }
  },
  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },
  "tooling": {
    "defaultNamespace": "Test.Web"
  },
  "dependencies": {
    "AutoMapper": "5.1.1",
    "FluentValidation.AspNetCore": "6.4.0-beta3",
    "MediatR": "2.1.0",
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.0.0",
    "Microsoft.AspNetCore.Authentication.OpenIdConnect": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Configuration.Binder": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Sendgrid": "8.0.3",
    "SimpleInjector.Integration.AspNetCore.Mvc": "3.2.3"
  },
  "frameworks": {
    "net46": {
      "dependencies": {
        "Test.Core": {
          "target": "project"
        }
      }
    }
  },
  "tools": {
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },
  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "config.json",
      "web.config"
    ]
  },
  "scripts": {
    "prepublish": [ "npm install", "gulp clean", "gulp build" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}
jvano commented 5 months ago

Hi

If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request

This way we can better track and assist you on this case

Thanks,

Joaquin Vano Azure App Service