與MVC

2014-02-10 25 views
0

SignalR錯誤我有一個叫啓動與MVC

這是類

[assembly: OwinStartup(typeof(MyApp.Startup))] 

namespace MyApp 
{ 
    public class Startup 
    { 
     public void Configuration(IAppBuilder app) 
     { 
      app.MapSignalR(); 
     } 
    } 
} 

但它從來沒有運行,並總是給我這個錯誤

The following errors occurred while attempting to load the app. 
- No assembly found containing an OwinStartupAttribute. 
- No assembly found containing a Startup or [AssemblyName].Startup class. 
To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config. 
To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config. 

我也曾嘗試在web.config中添加這些值,但它仍然給我erorr

<appSettings> 
<add key="owin:AppStartup" value="MyApp.Startup, MyApp" /> 
<add key="owin:AutomaticAppStartup" value="true" /> 
</appSettings> 
+0

你檢查了你用於Signal R和其他相關DLL必須相同的版本。 – cracker

回答

0

請檢查Startup.cs屬性是內容類型還是編譯類型。你給出的代碼應該可以正常工作。只需在Visual Studio中右鍵單擊該文件並檢查編譯或內容類型的屬性。也讓我知道你是否得到任何編譯時錯誤。