建立Windows Azure應用中遇到的一些問題

來源:互聯網
上載者:User

距離上次看Windows Azure有一段時間了,今天在用VS2010建立Windows Azure時出現了不少問題,這裡做個記錄。

首先是建立好Windows Azure模版項目,啟動調試時Windows Azure儲存模擬器初始化失敗,錯誤資訊為:

Failed to initialize Windows Azure storage emulator.

其實按照錯誤資訊中的提示,查看output視窗,資訊如下:

output window:

Windows Azure Tools: Failed to initialize Windows Azure storage emulator. Unable to start Development Storage. Failed to start Storage Emulator: the SQL Server instance ‘localhost\SQLExpress’ could not be found.   Please configure the SQL Server instance for Storage Emulator using the ‘DSInit’ utility in the Windows Azure SDK.

這個Windows Azure儲存模擬器需要本地的Sql Express,我平時為了節省資源把Sql Server服務全部都停掉了。但發現啟動服務後還是有問題,於是按照錯誤資訊中的提示,運行一下DSInit命令還重新初始化儲存模擬器:

在Visual Studio Command Prompt (2010)命令列工具中輸入:

cd C:\Program Files\Windows Azure Emulator\emulator\devstore

DSInit /forcecreate

執行結果如下,初始化成功。

 

然後啟動調試,前面的錯誤資訊消失。

這是如果用Sql Server management studio開啟Sql Express,會發現其中有個一個資料庫DevelopmentStorageDb20110816,

但是頁面並未運行正常,而是出現如下錯誤資訊:

Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.TypeLoadException: Could not load type 'System.ServiceModel.Activation.HttpModule' from assembly 'System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

放狗搜了一下,找到http://support.microsoft.com/kb/2015129中解釋了原因和解決辦法。也許我在安裝好.net framework 4.0後,因為某些原因有安裝了更低版本的.net架構。解決辦法就是用asp.net 4.0重新註冊IIS:

cmd視窗中運行

aspnet_regiis.exe /iru

aspnet_regiis位於如下位置:

%windir%\Microsoft.NET\Framework\v4.0.30319

%windir%\Microsoft.NET\Framework64\v4.0.30319 (64位)

 

到此環境又恢複了正常。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.