2012-08-10 10 views
5

Mit Visual Studio 2012 RC von der Seite habe ich einen Azure Cloud Service gestartet. Ich habe MVC 4 ausgewählt, ein Testprojekt eingeschlossen und die NuGet-Paketwiederherstellung beim Build aktiviert.Fehlende Microsoft.WindowsAzure.Diagnostics während der Implementierung der Webrolle

Als ich dies eine Azure Web-Site bereitgestellt, mit git, so scheint es, dass das Zielfeld weder die WindowsAzure.Diagnosticsoder die WindowsAzure.ServiceRuntime Bibliotheken enthält. Ich bin neu bei .NET im Allgemeinen, aber ich kann mir nicht vorstellen, was ich hier vermisse. Außerdem, während ich Diagnostics aus den Referenzen trivial entfernen kann (keine Diagnose, kein Problem), scheint es nicht, dass ich dasselbe mit ServiceRuntime machen kann.

Mache ich etwas falsch, oder ist das ein Fehler in Azure-Websites? Ist es reparierbar?

C:\... [master]> git push azure master 
Counting objects: 17, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (11/11), done. 
Writing objects: 100% (12/12), 216.47 KiB, done. 
Total 12 (delta 5), reused 0 (delta 0) 
remote: New deployment received. 
remote: Updating branch 'master'. 
remote: Preparing deployment for commit id '2cb9c59bd0'. 
remote: Building web project 'MvcWebRole1.csproj'. 
remote: .. 
remote: Successfully installed 'Microsoft.AspNet.WebApi 4.0.20505.0'. 
remote: Successfully installed 'Microsoft.AspNet.Web.Optimization 1.0.0-beta2'. 
remote: Successfully installed 'jQuery.Validation 1.8.1'. 
remote: Successfully installed 'Microsoft.AspNet.Razor 2.0.20505.0'. 
remote: Successfully installed 'Microsoft.AspNet.Providers.Core 1.0'. 
remote: Successfully installed 'Microsoft.AspNet.Providers.LocalDb 1.0'. 
remote: Successfully installed 'jQuery.UI.Combined 1.8.11'. 
remote: Successfully installed 'jQuery 1.6.2'. 
remote: Successfully installed 'Microsoft.AspNet.WebApi.Client 4.0.20505.0'. 
remote: Successfully installed 'Microsoft.AspNet.Mvc 4.0.20505.0'. 
remote: Successfully installed 'Microsoft.AspNet.WebApi.Core 4.0.20505.0'. 
remote: Successfully installed 'Microsoft.AspNet.WebApi.WebHost 4.0.20505.0'. 
remote: Successfully installed 'Microsoft.jQuery.Unobtrusive.Ajax 2.0.20505.0'. 
remote: Successfully installed 'Microsoft.jQuery.Unobtrusive.Validation 2.0.20505.0'. 
remote: Successfully installed 'Microsoft.Web.Infrastructure 1.0.0.0'. 
remote: Successfully installed 'Microsoft.AspNet.WebPages 2.0.20505.0'. 
remote: Successfully installed 'Modernizr 2.0.6'. 
remote: Successfully installed 'Microsoft.WindowsAzure.ConfigurationManager 1.7.0.0'. 
remote: Successfully installed 'Microsoft.Net.Http 2.0.20505.0'. 
remote: Successfully installed 'WebGrease 1.0.0'. 
remote: Successfully installed 'EntityFramework 5.0.0-rc'. 
remote: Successfully installed 'WindowsAzure.Storage 1.7.0.0'. 
remote: Successfully installed 'knockoutjs 2.0.0'. 
remote: Successfully installed 'Newtonsoft.Json 4.5.1'. 
remote: D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resol 
ve this reference. Could not locate the assembly "Microsoft.WindowsAzure.Diagnostics, Version=1.7.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35". 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\barf\VirtualDirectory0\site\repository\MvcWebRole1\MvcWebRole1 
.csproj] 
remote: D:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3245: Could not resol 
ve this reference. Could not locate the assembly "Microsoft.WindowsAzure.ServiceRuntime, Version=1.7.0.0, Culture=neutra 
l, PublicKeyToken=31bf3856ad364e35". Check to make sure the assembly exists on disk. If this reference is required by yo 
ur code, you may get compilation errors. [C:\DWASFiles\Sites\barf\VirtualDirectory0\site\repository\MvcWebRole1\MvcWebRo 
le1.csproj] 
remote: WebRole.cs(5,30): error CS0234: The type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.WindowsAzure' (are you missing an assembly reference?) [C:\DWASFiles\Sites\barf\VirtualDirectory0\site\repository\Mv 
cWebRole1\MvcWebRole1.csproj] 
remote: WebRole.cs(6,30): error CS0234: The type or namespace name 'ServiceRuntime' does not exist in the namespace 'Microsoft.WindowsAzure' (are you missing an assembly reference?) [C:\DWASFiles\Sites\barf\VirtualDirectory0\site\repository\MvcWebRole1\MvcWebRole1.csproj] 
remote: WebRole.cs(10,28): error CS0246: The type or namespace name 'RoleEntryPoint' could not be found (are you missing a using directive or an assembly reference?) [C:\DWASFiles\Sites\barf\VirtualDirectory0\site\repository\MvcWebRole1\Mvc 
WebRole1.csproj] 
remote: 
remote: Error - Changes committed to remote repository but your website not updated. 
+0

Haben Sie überprüft, ob auf dem Server eine fehlerhafte Datei vorhanden ist, die den Referenzierungsfehler verursacht? accordig zu http://weblogs.asp.net/srkirkland/archive/2012/08/08/git-deployment-to-an-azure-website-keeping-configuration-secrets.aspx, die Kudu-Deployment-Engine, die den git antreibt Bereitstellungen hier werden nicht gelöscht und Dateien auf dem Ziel, auch wenn aus der Quelle entfernt. Sie könnten ftp in und sehen, ob es einige Dlls in Ihrem bin dir auf dem Server, die nicht da sein sollten ... oder löschen Sie sie alle und re-deploy frisch ... –

+0

Ich habe das gleiche Problem auch, Ich denke, ein Teil davon hat mit dem Pfad zu tun, auf dem sich die DLLs befinden. Mein Projekt scheint C: \ ProgramFiles für diese DLLs anstelle eines projektspezifischen Pfads zu verweisen. –

Antwort

9

Dieser Fehler wird aufgrund der Baugruppenreferenz angezeigt.

Wenn installiert Microsoft SDK, werden die Referenzen dort im Referenzordner.Wenn es nicht da ist, dann müssen wir durchsuchen in Lösung.Ebenfalls habe ich das gleiche Problem beim Ausführen der Lösung.Jetzt löste ich dieses Problem und seine Arbeit fein.

Wenn wir Windows Azure sdk

"C: \ Programme \ Microsoft SDKs \ Windows Azure \ .NET SDK \ 2012-10 \ ref" installiert wird

alle Referenzen here.just fügen diese Referenzen in Ihre Lösung und bauen sie, wird funktionieren.

Hoffnung kann dies hilfreich,

Danke,

+3

http://www.microsoft.com/en-us/download/details.aspx?id=35448 heruntergeladen jeder von ihnen und installiert. funktioniert jetzt –

+0

http://stackoverflow.com/questions/13429867/azure-git-deployment-missing-references-in-2nd-assembly –

0

Ich glaube, das liegt daran, dass Sie Visual Studio 2012 Release Candidate und die Windows Azure Tools für Visual Studio 2012 noch nicht freigegeben verwenden. Versuchen Sie denselben Code mit Visual Studio 2010, und alle Ihre Assemblys sollten gefunden und Probleme behoben werden.

4

Diese Frage eindeutig zu beantworten ist.

Die einfachste Lösung ist jedoch, die AzureSDK2.2DLLs zu Ihrem Web-Rolle-Projekt (s) hinzuzufügen.

Verwandte Themen