【发布时间】:2014-03-09 04:57:03
【问题描述】:
我复制了一个以前的项目并将其重命名。一旦我成功地重命名了所有命名空间并且它构建正确。运行应用程序时出现以下错误:
The following errors occurred while attempting to load the app.
- The OwinStartup attribute discovered in assembly 'User Manager Interface' referencing startup type 'User_Manager_Interface.Startup' conflicts with the attribute in assembly 'Service Monitor Web Interface' referencing startup type 'Service_Monitor_Web_Interface.Startup' because they have the same FriendlyName ''. Remove or rename one of the attributes, or reference the desired type directly.
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.
我发现如果我注释掉下面的第一行,错误就会消失。
//[assembly: OwinStartupAttribute(typeof(Service_Monitor_Web_Interface.Startup))]
namespace Service_Monitor_Web_Interface
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
}
}
我将解决方案从 User_Manager_Interface 重命名为 Service_Monitor_Web_Interface。
我似乎找不到任何使用旧名称的地方,但它提到的错误中存在差异。
【问题讨论】:
-
我也有同样的问题。找到解决方案的任何答案或运气?
-
我刚刚删除了项目并重新开始。只重命名类和命名空间。
标签: asp.net-mvc asp.net-mvc-5 owin asp.net-authentication