【问题标题】:Github -> Azure Deployment: Cant find pathGithub -> Azure 部署:找不到路径
【发布时间】:2016-03-15 11:35:29
【问题描述】:

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

WebCompiler: Begin compiling compilerconfig.json
D:\home\site\repository\src\BeYourMarket.Web\Themes\Default\Content\theme.less : WebCompiler error 0: The system cannot find the path specified. [D:\home\site\repository\src\BeYourMarket.Web\BeYourMarket.Web.csproj]
D:\home\site\repository\src\BeYourMarket.Web\Themes\Default\Content\theme.less : WebCompiler error 0:  [D:\home\site\repository\src\BeYourMarket.Web\BeYourMarket.Web.csproj]
  WebCompiler: Done compiling compilerconfig.json
Failed exitCode=1, command="D:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "D:\home\site\repository\src\BeYourMarket.Web\BeYourMarket.Web.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="D:\local\Temp\8d34cc45ff19d01";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release;UseSharedCompilation=false /p:SolutionDir="D:\home\site\repository\src\\"
An error has occurred during web site deployment

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

【问题讨论】:

  • 由于错误是在编译 .less 文件时缺少文件,我猜您的本地计算机上有另一个 .less 或 .css 文件,但您的 Git 存储库中不存在。
  • 我在 Github 上的正确文件夹中有 css 和 less 文件:/src/BeYourMarket.Web/Themes/Default/Content/ 或者这不是正确的文件夹?
  • 我还检查了 azure-server。该文件存在于指定文件夹中。我不知道为什么它说找不到路径。

标签: asp.net-mvc azure github azure-git-deployment


【解决方案1】:

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

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

【讨论】:

    【解决方案2】:

    最后我是这样处理的:

    1. 安装包LessMsbuildTasks
    2. 删除文件(在我的情况下为 theme.less)来自 webcompile(右键单击该文件:Web Compiler - 删除文件)
    3. 为该文件添加 Dotless 作为构建操作(右键单击该文件:属性 - 构建操作)
    4. 提交更改并推送

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-08-21
      • 1970-01-01
      • 2021-11-12
      • 2018-01-17
      • 2019-10-18
      • 1970-01-01
      • 2021-07-10
      • 2021-05-21
      相关资源
      最近更新 更多