Zap*_*ica 75 asp.net-mvc asp.net-authentication owin asp.net-mvc-5
我复制了以前的项目并将其重命名.一旦我成功重命名所有名称空间并正确构建.运行应用程序时出现以下错误:
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.
Run Code Online (Sandbox Code Playgroud)
我已经发现,如果我在下面的第一行注释掉那么错误就会消失.
//[assembly: OwinStartupAttribute(typeof(Service_Monitor_Web_Interface.Startup))]
namespace Service_Monitor_Web_Interface
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我将我的解决方案从User_Manager_Interface重命名为Service_Monitor_Web_Interface.
我似乎无法找到任何具有旧名称的地方,在它提到的错误中如何.
Fer*_*eci 167
我已经有过几次这个问题了,所以我会写下我遵循的程序,以提醒自己:
Mil*_*hev 30
如果在同一bin文件夹中有两个包含OwinStartup类的程序集,则会出现此问题.通常,您不应该为同一个Web应用程序使用两个OwinStartup类.
您可以通过检查bin文件夹来解决此问题.如果在重命名后,具有旧名称的程序集仍保留在bin文件夹中,则会出现此错误.要解决它,请从bin文件夹中删除所有内容.
我没有重命名我的解决方案,但我遇到了这个问题.我无法在任何地方找到解决方案.我在同一台服务器上有一个owin启动类的2个独立项目.我只是给每个人一个不同的"友好名称",如异常消息中所建议的,它解决了它.我发现了一篇很好的文章:
要重命名它,您需要做的就是在OwinStartup上添加一个字符串,如下所示:
[assembly:OwinStartup("ProductionConfiguration",typeof(StartupDemo.ProductionStartup2))]
| 归档时间: |
|
| 查看次数: |
36699 次 |
| 最近记录: |