首页 文章

更新到MVC 5.2.2后,Azure git部署失败

提问于
浏览
1

我有一个天蓝色的网站,从github自动git部署运行良好 . 现在我已经更新了站点以使用ASP.Net MVC 5.2.2,并且部署失败并且“找不到类型或命名空间名称'AllowAnonymous'” .

该网站在我的本地计算机上构建得很好,即使我将其克隆到一个干净的目录,以便必须再次下载nuget包 .

失败的csproj文件中对MVC包的引用表明它错误地引用了包而不是某些GACed dll .

<Reference Include="System.Web.Mvc, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.2\lib\net45\System.Web.Mvc.dll</HintPath>
</Reference>

构建失败的最新版本是https://github.com/KentorIT/authservices/commit/665fad58e64646da72ccc58ff080e0f7d71cc234 .

完成错误

命令:“D:\ home \ site \ deployments \ tools \ deploy.cmd”处理.NET Web应用程序部署 . Kentor.AuthServices - > D:\ home \ site \ repository \ Kentor.AuthServices \ bin \ Release \ Kentor.AuthServices.dll AuthServicesController.cs(13,6):错误CS0246:类型或命名空间名称'AllowAnonymous'不能是发现(您是否缺少using指令或程序集引用?)[D:\ home \ site \ repository \ Kentor.AuthServices.Mvc \ Kentor.AuthServices.Mvc.csproj] AuthServicesController.cs(13,6):错误CS0246:找不到类型或命名空间名称'AllowAnonymousAttribute'(您是否缺少using指令或程序集引用?)[D:\ home \ site \ repository \ Kentor.AuthServices.Mvc \ Kentor.AuthServices.Mvc.csproj]失败exitCode = 1,command =“D:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ MSBuild.exe”“D:\ home \ site \ repository \ Kentor.AuthServices.StubIdp \ Kentor.AuthServices.StubIdp.csproj” / nologo / verbosity:m / t:build / t:pipelinePreDeployCopyAllFilesToOneFolder / p:_PackageTempDir =“C:\ DWASFiles \ Sites \ ~11.ubidp \ Temp \ 3173ac06-c440-4bd9-a8c5-f27fecf3d007”; AutoParameterizationWebConfigConnectionS trings = false; Configuration = Release / p:Configuration = Release网站部署期间发生错误 . 处理.NET Web应用程序部署 . Kentor.AuthServices - > D:\ home \ site \ repository \ Kentor.AuthServices \ bin \ Release \ Kentor.AuthServices.dll AuthServicesController.cs(13,6):错误CS0246:类型或命名空间名称'AllowAnonymous'不能是发现(您是否缺少using指令或程序集引用?)[D:\ home \ site \ repository \ Kentor.AuthServices.Mvc \ Kentor.AuthServices.Mvc.csproj] AuthServicesController.cs(13,6):错误CS0246:找不到类型或命名空间名称'AllowAnonymousAttribute'(您是否缺少using指令或程序集引用?)[D:\ home \ site \ repository \ Kentor.AuthServices.Mvc \ Kentor.AuthServices.Mvc.csproj]失败exitCode = 1,command =“D:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ MSBuild.exe”“D:\ home \ site \ repository \ Kentor.AuthServices.StubIdp \ Kentor.AuthServices.StubIdp.csproj” / nologo / verbosity:m / t:build / t:pipelinePreDeployCopyAllFilesToOneFolder / p:_PackageTempDir =“C:\ DWASFiles \ Sites \ ~11.ubidp \ Temp \ 3173ac06-c440-4bd9-a8c5-f27fecf3d007”; AutoParameterizationWebConfigConnectionS trings = false; Configuration = Release / p:Configuration = Release网站部署期间发生错误 . D:\ Program Files(x86)\ SiteExtensions \ Kudu \ 30.31023.1215 \ bin \ scripts \ starter.cmd“D:\ home \ site \ deployments \ tools \ deploy.cmd”

1 回答

  • 0

    存储库包含多个解决方案文件,作为部署过程的一部分运行的 nuget restore 命令不支持该文件 . 在更新nuget包之前,必须在Azure服务器上的GAC中提供所需的MVC版本 . 现在失败了 .

    解决方案是删除额外的.sln文件,以便目录中只有一个.sln文件 .

相关问题