Github -> Azure Deployment:找不到路径



我正在尝试部署一个 .NET-MVC 应用程序通过 Github 到 Azure,但部署失败并显示以下错误消息。可能是什么原因呢?它在本地工作。

WebCompiler: Begin compiling compilerconfig.json
D:homesiterepositorysrcBeYourMarket.WebThemesDefaultContenttheme.less : WebCompiler error 0: The system cannot find the path specified. [D:homesiterepositorysrcBeYourMarket.WebBeYourMarket.Web.csproj]
D:homesiterepositorysrcBeYourMarket.WebThemesDefaultContenttheme.less : WebCompiler error 0:  [D:homesiterepositorysrcBeYourMarket.WebBeYourMarket.Web.csproj]
  WebCompiler: Done compiling compilerconfig.json
Failed exitCode=1, command="D:Program Files (x86)MSBuild14.0BinMSBuild.exe" "D:homesiterepositorysrcBeYourMarket.WebBeYourMarket.Web.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:localTemp8d34cc45ff19d01";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:homesiterepositorysrc\"
An error has occurred during web site deployment

提前感谢您的任何提示和提示!

这是WebCompiler项目当前未解决的问题。Azure 文件系统以本地环境未锁定的方式锁定。即使该文件存在于服务器上的路径中,部署脚本也无法读取它。

在扫描有关问题 (https://github.com/madskristensen/WebCompiler/issues/146) 的评论时,除了预编译 CSS 并将其包含在存储库中之外,目前似乎没有解决方案。

最后我按以下方式处理它:

  1. 安装包 LessMsbuildTasks
  2. 从webcompile中删除 文件(在我的例子中是theme.less)(右键单击该文件:Web 编译器 - 删除文件)
  3. 添加无点作为该文件的构建操作(右键单击该文件:属性 - 构建操作)
  4. 提交更改并推送

接下来的两个步骤是可选的:

  1. compilerconfig.json 放在 .gitignore 上
  2. 再次将该文件添加到 Web 编译器(右键单击该文件:Web 编译器 - 编译文件)

这样,我仍然可以使用持续编译来开发并将其推送到我的存储库,以在 Azure 上启动 CI。

最新更新