我复制了以前的一个项目并将其重命名。一旦我成功地重命名了所有的命名空间,它就可以正确构建了。当我运行应用程序时,我得到了以下错误:
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。
我似乎找不到任何有这个旧名字的地方,但是在错误的地方提到了它。
发布于 2014-10-03 17:01:22
如果在包含OwinStartup类的同一个bin文件夹中有两个程序集,则会出现此问题。通常情况下,同一个web应用程序不应该有两个OwinStartup类。
你可以通过检查bin文件夹来解决这个问题。如果重命名后,具有旧名称的程序集仍保留在bin文件夹中,则会出现此错误。要解决此问题,请删除bin文件夹中的所有内容。
发布于 2014-03-04 11:00:29
在重命名解决方案的程序集后,我也遇到了同样的问题。
我通过确保OwinStartupAttritbute引用我的新程序集名称来解决这个问题。
下一步是删除在bin文件夹中找到的旧程序集。
发布于 2014-07-13 11:41:33
我没有重命名我的解决方案,但我确实遇到了这个问题。我在任何地方都找不到关于这个问题的解决方案。我在同一台服务器上有两个独立的项目,一个owin启动类。我简单地按照异常消息中的建议,给每个人起了一个不同的“友好名称”,它解决了这个问题。我找到了一篇关于这方面的好文章:
要重命名它,您只需在OwinStartup上添加一个字符串,如下所示:
程序集: OwinStartup("ProductionConfiguration",typeof(StartupDemo.ProductionStartup2))
https://stackoverflow.com/questions/21701297
复制相似问题