Kentico 12 DancingGoat MVC SiteName 为空或为空

lea*_*... 3 kentico

我已经安装了 DancingGoat MVC,我可以很好地访问 IIS url

http://localhost:8080/Kentico12_DancingGoatMvc

http://localhost:8080/Kentico12_Admin/Admin/cmsadministration.aspx

当我尝试调试 MVC 应用程序以查看示例站点的内部工作原理时,在 StartUp.auh.cs 文件中,我得到SiteName is empty or null exception.

例外在以下行

// Register Kentico Membership identity implementation
app.CreatePerOwinContext(() => UserManager.Initialize(app, new UserManager(new UserStore(SiteContext.CurrentSiteName))));
Run Code Online (Sandbox Code Playgroud)

我该如何纠正?

小智 6

MVC 项目可能在您的 Visual Studio 中设置为在与 :8080 不同的端口下启动。打开 MVC 项目的属性,转到 web 选项卡并记下项目 URL 字段中http://localhost后面的端口。然后,回到 Kentico,转到站点工具,对于 Dancing Goat 站点,将 URL 和端口添加到站点的域别名(或更改站点设置中的默认值)。重新启动一切,你应该一切顺利。除此之外,请确保您的站点和本地主机等拥有有效的许可证。