我复制了以前的项目并将其重命名。一旦我成功重命名了所有名称空间并且它构建正确。当我运行该应用程序时,出现以下错误:
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。
我似乎找不到任何使用旧名称的地方,但在错误中提到了它。
我已经遇到过这个问题好几次了,所以我将写下我遵循的过程,也作为对自己的提醒:
- 将所有旧解决方案名称替换为新解决方案名称。
- 导航特性在每个项目下并更改组件名称 and 默认命名空间字段到新的解决方案名称。
- 转到解决方案文件夹并使用新的解决方案名称重命名所有项目文件夹。
- 删除下面的所有文件bin and obj文件夹。
- 解决方案将无法加载项目。删除所有项目并重新添加它们。
- 重新构建项目。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)