2013-09-26 38 views
5

我使用Owin Startup類開發了一個應用程序。當我運行OwinHost.exe時,它顯示No Assembly found containing OwinStartupAttributeOwin啓動檢測

但是我在啓動類中定義的組件:在Web.config文件中

[assembly: OwinStartup(typeof(OwinDemo.BrandStartup))] 

我也定義爲的appSettings:

<appSettings> 
<add key="owin:AppStartup" value="OwinDemo.Startup, OwinDemo"/> 

+1

你運行的Owinhost.exe應用程序文件夾?這裏是關於OWIN啓動檢測的詳細教程。你能檢查這是否有幫助嗎? http://www.asp.net/aspnet/overview/owin-and-katana/owin-startup-class-detection – Praburaj

+0

並且在當前設置中,您在屬性和配置中具有不同的啓動類(屬性中的BrandStartup和啓動在appSetting中),配置有望獲勝。你可以檢查一下OwinDemo程序集中是否有一個名爲OwinDemo.Startup的類? – Praburaj

+0

@Praburaj感謝您的回覆。其實我已經在那篇文章的幫助下開發了我的應用程序。我的應用程序中有我的啓動類。我有多個啓動類,我想用我最初的啓動類啓動我的應用程序。但同樣的錯誤來臨。 –

回答

9

項目 - >右鍵點擊添加新項目。

Startup.cs

using Microsoft.Owin; 
using Owin; 

[assembly: OwinStartup(typeof(SignalRChat.Startup))] 
namespace SignalRChat 
{ 

    public class Startup 
    { 
     public void Configuration(IAppBuilder app) 
     { 
      app.MapSignalR(); 
     } 
    } 
} 
+1

爲什麼這是正確的答案?我試圖區分這個答案的建議和提問者已經說過他在啓動課上使用的OwinStartup屬性。 – DannyMeister