Azure Web サイトへの Bitbucket デプロイをセットアップしようとしています。Bitbucket と Azure を正常にリンクしましたが、Bitbucket にプッシュすると、Azure サイトで次のエラーが表示されます。
[ログの表示] をクリックすると、次のコンパイル エラーが表示されます。
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]
これらのコンパイル エラーは、プロジェクト内の別のアセンブリ (ビジネス ロジックを配置したアセンブリ) に対するものであることに注意してください。
グーグルで調べたとき、私が見つけた唯一の言及は、それらの参照に対して「ローカルコピー」フラグをtrueに設定する必要があることについてでした。これを試しましたが、それでも同じエラーが発生します。
これはすべてローカルで正常にコンパイルされます。何か案は?
アップデート
もう少し情報を追加するために、Git リポジトリにある私のプロジェクト構造は次のとおりです。
+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 アセンブリ参照を参照しています。
このレイアウトは、VisualStudio が作成したもの (つまり、webroot 用の追加のプロジェクト サブディレクトリ) であることに注意してください。
Git デプロイを行うときに Azure が何をするのか、よくわかりません。ProjName ディレクトリが webroot であることを認識し、ProjName.sln を解析して、ソリューション内にある他のアセンブリをコンパイルしますか (Visual Studio と同じ方法で)?
また、「bin」フォルダーを Git に追加していません。ただし、これをテストとして試しただけで、Azure が生成したコンパイル エラーは変わりませんでした。