简体   繁体   English

将ASP.NET 5应用程序部署到Azure

[英]Deploying asp.net 5 application to azure

I am trying to deploy my asp.net 5 mvc application to azure. 我正在尝试将asp.net 5 mvc应用程序部署到Azure。 First time I faced this error: 我第一次遇到这个错误:

Deployment template validation failed: 'The provided value for the template parameter 'sku' at line '16' and column '17' is not valid.'. 部署模板验证失败:“在行'16'和列'17'处为模板参数'sku'提供的值无效。”。

Fixed it by creating web app in azure portal instead from visual studio. 通过在Azure门户中而不是从Visual Studio中创建Web应用程序来修复此问题。

Now I have this error: 现在我有这个错误:

Error EPERM, open 'C:\\Windows\\npm-debug.log' MapApp DNU 0 错误EPERM,打开'C:\\ Windows \\ npm-debug.log'MapApp DNU 0

Cant find the solution of this problem , I tried to clean and rebuild my project, reopen visual studio. 无法找到此问题的解决方案,我试图清理并重建我的项目,重新打开Visual Studio。 Also when I launch my app in local mode all is fine (ie no errors appears ). 另外,当我在本地模式下启动我的应用程序时,一切都很好(即,没有错误出现)。

PS Full error stack: PS Full错误堆栈:

------ Publish started: Project: MapApp, Configuration: Release Any CPU ------ Environment variables: Path=\\Mac\\Home\\Desktop\\Work\\DemoApps\\MapApp\\Server\\MapApp\\src\\MapApp\\node_modules.bin;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\extensions\\microsoft\\web tools\\external;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\NativeBinaries\\x86;C:\\Program Files (x86)\\Parallels\\Parallels Tools\\Applications;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\system32\\config\\systemprofile.dnx\\bin;C:\\Program Files\\Microsoft DNX\\Dnvm\\;C:\\Program Files (x86)\\Windows Kits\\10\\Windows Performance Toolkit\\;C:\\Program Files\\Microsoft SQL Server\\110\\Tools\\Binn\\;C:\\Users\\max.dnx\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\extensions\\microsoft\\web tools\\external.git C:\\Users\\max.dnx\\runtimes\\dnx-clr-win-x86.1.0.0-beta5\\bin\\dnu.cmd publ ------开始发布:项目:MapApp,配置:释放任何CPU ------环境变量:Path = \\ Mac \\ Home \\ Desktop \\ Work \\ DemoApps \\ MapApp \\ Server \\ MapApp \\ src \\ MapApp \\ node_modules.bin; C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ Common7 \\ IDE \\ extensions \\ microsoft \\ web工具\\ external; C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ Common7 \\ IDE \\ CommonExtensions \\ Microsoft \\ TeamFoundation \\ Team Explorer \\ NativeBinaries \\ x86; C:\\ Program Files(x86)\\ Parallels \\ Parallels Tools \\ Applications; C:\\ Windows \\ system32; C:\\ Windows; C:\\ Windows \\ System32 \\ Wbem; C :\\ Windows \\ System32 \\ WindowsPowerShell \\ v1.0 \\; C:\\ Windows \\ system32 \\ config \\ systemprofile.dnx \\ bin; C:\\ Program Files \\ Microsoft DNX \\ Dnvm \\; C:\\ Program Files(x86)\\ Windows套件\\ 10 \\ Windows Performance Toolkit \\; C:\\ Program Files \\ Microsoft SQL Server \\ 110 \\ Tools \\ Binn \\; C:\\ Users \\ max.dnx \\ bin; C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ Common7 \\ IDE \\ extensions \\ microsoft \\ web工具\\ external.git C:\\ Users \\ max.dnx \\ runtimes \\ dnx-clr-win-x86.1.0.0-beta5 \\ bin \\ dnu.cmd publ ish "\\Mac\\Home\\Desktop\\Work\\DemoApps\\MapApp\\Server\\MapApp\\src\\MapApp" --out "C:\\Users\\max\\AppData\\Local\\Temp\\PublishTemp" --configuration Release --runtime dnx-clr-win-x86.1.0.0-beta5 --wwwroot-out "wwwroot" --quiet '\\Mac\\Home\\Desktop\\Work\\DemoApps\\MapApp\\Server\\MapApp\\src\\MapApp' CMD.EXE was started with the above path as the current directory. ish“ \\ Mac \\ Home \\ Desktop \\ Work \\ DemoApps \\ MapApp \\ Server \\ MapApp \\ src \\ MapApp” --out“ C:\\ Users \\ max \\ AppData \\ Local \\ Temp \\ PublishTemp”-配置发布-运行时dnx -clr-win-x86.1.0.0-beta5 --wwwroot-out“ wwwroot” --quiet'\\ Mac \\ Home \\ Desktop \\ Work \\ DemoApps \\ MapApp \\ Server \\ MapApp \\ src \\ MapApp'CMD.EXE已启动使用上述路径作为当前目录。 UNC paths are not supported. 不支持UNC路径。 Defaulting to Windows directory. 默认为Windows目录。 Microsoft .NET Development Utility CLR-x86-1.0.0-beta5-12103 Executing script 'prepublish' in project.json '\\Mac\\Home\\Desktop\\Work\\DemoApps\\MapApp\\Server\\MapApp\\src\\MapApp' CMD.EXE was started with the above path as the current directory. Microsoft .NET开发实用程序CLR-x86-1.0.0-beta5-12103在project.json'\\ Mac \\ Home \\ Desktop \\ Work \\ DemoApps \\ MapApp \\ Server \\ MapApp \\ src \\ MapApp'中执行脚本'prepublish'CMD.EXE使用上述路径作为当前目录启动。 UNC paths are not supported. 不支持UNC路径。 Defaulting to Windows directory. 默认为Windows目录。 npm ERR! npm ERR! install Couldn't read dependencies 安装无法读取依赖项

npm ERR! npm ERR! package.json ENOENT, open 'C:\\Windows\\package.json' package.json ENOENT,打开“ C:\\ Windows \\ package.json”

npm ERR! npm ERR! package.json This is most likely not a problem with npm itself. package.json这很可能不是npm本身的问题。

npm ERR! npm ERR! package.json npm can't find a package.json file in your current directory. package.json npm在当前目录中找不到package.json文件。

npm ERR! npm ERR! System Windows_NT 6.2.9200 系统Windows_NT 6.2.9200

npm ERR! npm ERR! command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node" "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" npm ERR! 命令“ C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft \\ Web Tools \\ External \\\\ node \\ node”“ C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft \\ Web工具\\外部\\ npm \\ node_modules \\ npm \\ bin \\ npm-cli.js“”安装“ npm ERR! cwd C:\\Windows CWD C:\\ Windows

npm ERR! npm ERR! node -v v0.10.31 节点-v v0.10.31

npm ERR! npm ERR! npm -v 1.4.9 npm -v 1.4.9

npm ERR! npm ERR! path C:\\Windows\\package.json 路径C:\\ Windows \\ package.json

npm ERR! npm ERR! code ENOPACKAGEJSON 代码ENOPACKAGEJSON

npm ERR! npm ERR! errno 34 埃尔诺34

DNU(0,0): Error : EPERM, open 'C:\\Windows\\npm-debug.log' DNU(0,0):错误:EPERM,打开'C:\\ Windows \\ npm-debug.log'

npm ERR! npm ERR! { [Error: EPERM, open 'C:\\Windows\\npm-debug.log'] errno: 50, code: 'EPERM', path: 'C:\\Windows\\npm-debug.log' } npm ERR! {[错误:EPERM,打开'C:\\ Windows \\ npm-debug.log']错误号:50,代码:'EPERM',路径:'C:\\ Windows \\ npm-debug.log'} npm ERR!

npm ERR! npm ERR! Please try running this command again as root/Administrator. 请尝试以root / Administrator身份再次运行此命令。

npm ERR! npm ERR! System Windows_NT 6.2.9200 系统Windows_NT 6.2.9200

npm ERR! npm ERR! command "C:\\Program Files (x86)\\Microsoft Visual Studio 命令“ C:\\ Program Files(x86)\\ Microsoft Visual Studio

14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node" "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" 14.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft \\ Web Tools \\ External \\\\ node \\ node“” C:\\ Program Files(x86)\\ Microsoft Visual Studio 14.0 \\ Common7 \\ IDE \\ Extensions \\ Microsoft \\ Web Tools \\ External \\ npm \\ node_modules \\ npm \\ bin \\ npm-cli.js“”安装“

npm ERR! npm ERR! cwd C:\\Windows CWD C:\\ Windows

npm ERR! npm ERR! node -v v0.10.31 节点-v v0.10.31

npm ERR! npm ERR! npm -v 1.4.9 npm -v 1.4.9

npm ERR! npm ERR! path C:\\Windows\\npm-debug.log 路径C:\\ Windows \\ npm-debug.log

npm ERR! npm ERR! code EPERM 代码EPERM

npm ERR! npm ERR! errno 50 埃尔诺50

DNU(0,0): Error : EPERM, open 'C:\\Windows\\npm-debug.log' DNU(0,0):错误:EPERM,打开'C:\\ Windows \\ npm-debug.log'

The 'prepublish' script failed with status code 34. “预发布”脚本失败,状态码为34。

@Panich, I haven't seen that error myself so it will be hard to reproduce on my end. @Panich,我自己还没有看到该错误,因此很难再现。

I would suggest the following: create a new blank ASP.NET 5 web app, and deploy it to a test site on Azure. 我建议如下:创建一个新的空白ASP.NET 5 Web应用程序,并将其部署到Azure上的测试站点。 Add a few things to it, from your own application and redeploy it a couple of more times to see if it fails after adding any particular item. 从您自己的应用程序中添加一些内容,然后重新部署几次,以查看添加任何特定项目后它是否失败。

Hope that helps you narrow down the issue. 希望可以帮助您缩小问题范围。

I have just started with ASP.NET 5 and tried to create a self-hosted application. 我刚开始使用ASP.NET 5,并试图创建一个自托管应用程序。 Thereby (by deploy the app to a directory) I also had the error: 因此(通过将应用程序部署到目录),我也遇到了错误:

EPERM, open 'C:\Windows\npm-debug.log'       

I then have noted, that to deploy a project from a network share seems not to be supported "out-of-the-box" (I think, there are some special settings / configurations to do, to make it work). 然后,我注意到,似乎不支持“即开即用”地从网络共享部署项目(我认为,要做一些特殊的设置/配置才能使其正常工作)。 Therefore, I have copied the project from the network-share to a local drive and then was able to deploy it. 因此,我已将项目从网络共享复制到本地驱动器 ,然后能够对其进行部署。 So.. I would try to copy the project to a local drive... 所以..我会尝试将项目复制到本地驱动器...

Link to my posting to the self-hosting: ASP.NET5 self-hosting, change localhost 链接到我的自托管文章: ASP.NET5自托管,更改本地主机

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM