2015-05-06 69 views
1

我剛升級到beta4。我的代碼編譯成功,沒有錯誤/警告,但我無法啓動我在IIS Express中託管的web api(擊中F5)。我收到以下錯誤:無法確定運行的適當版本運行

Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.

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.InvalidOperationException: Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.

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.

Stack Trace:

[InvalidOperationException: Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.] System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +303

[HttpException (0x80004005): Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9940016 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.57.0

這裏是輸出dnvm list

C:\src\web-api-skeleton [master]> dnvm list

Active Version Runtime Architecture Location Alias


  • 1.0.0-beta4 clr x64 C:\Users\dpeden.dnx\runtimes default
    1.0.0-beta4 clr x86 C:\Users\dpeden.dnx\runtimes
    1.0.0-beta4 coreclr x64 C:\Users\dpeden.dnx\runtimes
    1.0.0-beta4 coreclr x86 C:\Users\dpeden.dnx\runtimes
    1.0.0-beta4-11566 clr x86 C:\Users\dpeden.dnx\runtimes

我自己也嘗試明確設置(項目屬性的調試選項卡上Use Specific Runtime)運行時出現不有什麼影響。

從VS 2015 CTP 6和beta3升級到VS 2015 RC和beta4之前,我沒有遇到此問題。

我該如何解決?

謝謝。

Cross reference on ASP.NET Forums

回答

0

事實證明,這是一個簡單的問題。在閱讀https://github.com/aspnet/Announcements/issues/3後,我意識到我已將aspnet50更改爲dnx46,而它應該是dnx451。在對我所有的project.json文件進行更改後,我的問題已解決。

段:

「框架」:{ 「dnx451」:{}} ,