我使用Visual创建了一个DotVVM Core2.0项目,并启动了一个Business的试用版,该版本是我从私有提要添加到该项目中的。我已经在DotvvmStartup.cs在ConfigureServices注册了商务包。我在IntelliSense中没有看到bp控件,当我尝试使用bp控件运行web应用程序时,我会发现一个没有注册标签前缀的错误。
我使用VisualStudio2017社区的最新版本以及DotVVM和Business的最新版本。谢谢你的建议。
发布于 2018-12-20 13:37:00
也许您不会调用方法
DotvvmStartup.ConfigureServices。这是由VS2017扩展模板(v2.0.118.0及以下版本)和dotnet模板(dotvvm.templates.2.0.3)中的"bug“引起的。
请查一下Startup.ConfigureServices。
public void ConfigureServices(IServiceCollection services)
{
...
services.AddDotVVM(); //this line is incorrect
}您应该将services.AddDotVVM()替换为services.AddDotVVM<DotvvmStartup>(); https://github.com/riganti/dotvvm/blob/master/src/DotVVM.Framework.Hosting.AspNetCore/ServiceCollectionExtensions.cs#L17
这将创建DotvvmStartup的实例并调用方法DotvvmStartup.ConfigureServices。
DotvvmStartup对象被创建了2次(services.AddDotVVM<DotvvmStartup>()和app.UseDotVVM<DotvvmStartup>(env.ContentRootPath))。
https://stackoverflow.com/questions/51345002
复制相似问题