Azure的部署混帐 - 在第二装配丢失的引用 [英] Azure git deployment - missing references in 2nd assembly

查看:211
本文介绍了Azure的部署混帐 - 在第二装配丢失的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图安装到位桶部署到蔚蓝的网站。我已经成功到位桶和Azure的联系,但是当我推到位桶,我得到了Azure的网站出现以下错误:

I'm trying to setup Bitbucket deployment to an Azure website. I successfully have Bitbucket and Azure linked, but when I push to Bitbucket, I get the following error on the Azure site:

如果我点击查看日志,它显示了以下编译错误:

If I click on 'View Log', it shows the following compile errors:

    D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]
    D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "WebMatrix.WebData, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]
    CustomMembershipProvider.cs(5,7): error CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?) [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]
    CustomMembershipProvider.cs(9,38): error CS0246: The type or namespace name 'ExtendedMembershipProvider' could not be found (are you missing a using directive or an assembly reference?) [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]
    Models\AccountModels.cs(3,18): error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]
    CustomMembershipProvider.cs(198,37): error CS0246: The type or namespace name 'OAuthAccountData' could not be found (are you missing a using directive or an assembly reference?) [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]
    Models\AccountModels.cs(40,10): error CS0246: The type or namespace name 'Compare' could not be found (are you missing a using directive or an assembly reference?) [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]
    Models\AccountModels.cs(40,10): error CS0246: The type or namespace name 'CompareAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]
    Models\AccountModels.cs(73,10): error CS0246: The type or namespace name 'Compare' could not be found (are you missing a using directive or an assembly reference?) [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]
    Models\AccountModels.cs(73,10): error CS0246: The type or namespace name 'CompareAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\DWASFiles\Sites\<projname>\VirtualDirectory0\site\repository\<projname>.Common\<projname>.Common.csproj]

请注意,这些编译错误是对另一装配在我的项目(​​这里我把业务逻辑程序集)。

Note that these compile errors are against another assembly in my project (the assembly where I put the business logic).

谷歌搜索后,我发现,只有提起正要不必本地副本标志设置为true的引用。我想这一点,但仍然得到了同样的错误。

When Googling, the only mention I found was about having to set the "local copy" flag to true for those references. I've tried this, but still got the same errors.

这所有的本地编译罚款。任何想法?

This all compiles fine locally. Any ideas?

要添加更多的信息,我的项目结构,它是Git的回购如下:

To add a bit more information, my project structure that is in the Git repo is as follows:

+ProjName
    ProjName.csproj
    web.config
    ...etc...
+ProjName.Common
    ProjName.Common.csproj
+ProjName.Tests
    ProjName.Tests.csproj
+packages <-- these are Nuget packages
ProjName.sln

通过Azure的显示的编译错误说,这是ProjName.vcproj失败 - 但它们指的是ProjName.Common集引用

The compile errors shown by Azure say that it's ProjName.vcproj that failed - but they refer to the ProjName.Common assembly reference.

请注意,这个布局是什么样的VisualStudio创建(即用于Web根目录的额外项目的子目录)。

Note that this layout is what VisualStudio created (ie. an extra project subdirectory for the webroot).

我真的不知道做一个Git部署Azure的时候做什么。是否认识到ProjName目录的根目录,也解析ProjName.sln编制是在溶液(以同样的方式的Visual Studio做)任何其他组件?

I'm not really sure what Azure does when doing a Git deploy. Does it recognise that the ProjName directory is the webroot, and also parse the ProjName.sln compiling any other assemblies that are in the solution (the same way Visual Studio does)?

另外,我没有添加任何bin的文件夹的Git。不过,我也只是尝试这是一个测试,并没有改变的Azure产生的编译错误。

Also, I've not added any "bin" folders to Git. However, I did just try this as a test, and it didn't change the compile errors that Azure produced.

推荐答案

更​​新2012年11月25日:在看丹的回购之后,问题是图书馆项目从GAC使用MVC 4,而不是使用的NuGet包。切换到的NuGet包使得它做工精细在Azure上。

Updated 11/25/2012: After looking at Dan's repo, the problem is that the library project is using Mvc 4 from the GAC instead of using the NuGet package. Switching to the NuGet package makes it work fine on Azure.

在理论上,MVC4可以在GAC上天青机器,这将不会是一个问题。也许他们会在某个时候到达那里。虽然通常情况下,MVC开发团队正日益推动基于模型的NuGet,你不依赖的东西在GAC之中。

In theory, MVC4 could be in the GAC on the Azure machines and this would not be an issue. And maybe they'll get there at some point. Though generally, the MVC team is increasingly pushing a NuGet based model where you don't rely on things being in the GAC.

原来的答复:

通常情况下,你应该避免犯的二进制文件到你的混帐回购协议,而是依靠的NuGet找回它们。请参阅<一个href=\"https://github.com/KuduApps/Mvc4ApplicationFx40WithLib\">https://github.com/KuduApps/Mvc4ApplicationFx40WithLib为做到这一点,并在Azure网站工作正常。一个示例项目

Generally, you should avoid committing binaries to your git repo, instead relying on NuGet to retrieve them. Please see https://github.com/KuduApps/Mvc4ApplicationFx40WithLib for a sample project that does this and works fine in Azure Web Sites.

不过,根据您的项目结构,我看你的项目似乎使用C ++(的.vcproj)。如果是这样,那么,可能的问题是C ++可能无法在今天Azure网站通过混帐发布时支持。到目前为止,我不认为这又拿出了一样,一定的人使用C#和放大器; VB。如果这确实是问题,那么我建议你在 https://github.com/projectkudu/kudu 打开的问题,所以我们可以适当跟踪这一点。

But based on your project structure, I see that your projects seem to use C++ (.vcproj). If so, then the likely problem is that C++ may not be supported today in Azure Web Sites when publishing via git. So far, I don't think this has come up as must people use C# & VB. If that is indeed the issue, then I suggest you open an issue on https://github.com/projectkudu/kudu so we can properly track this.

这篇关于Azure的部署混帐 - 在第二装配丢失的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆