[英]PackageReference Microsoft.AspNetCore.App change of manner from core 2.2 to core 3 & 3.1
In the past, in my project I create a blank solution and add过去,在我的项目中,我创建了一个空白解决方案并添加
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.5" />
in class library, so I was able to refer this class library project to an others and use what I needed.在类库中,所以我能够将这个类库项目引用给其他人并使用我需要的。 For example in my solution I had Core
folder and Web
folder.例如,在我的解决方案中,我有Core
文件夹和Web
文件夹。 My web application started from "asp.net core web application" that was in Web folder and has reference to "Core" folder class libraries like core, data, services and ... .我的 Web 应用程序从位于 Web 文件夹中的“asp.net core Web 应用程序”开始,并引用了“Core”文件夹类库,如核心、数据、服务和...。
Now with ASP.NET Core 3 I have problem with this approach, it causes an error;现在使用 ASP.NET Core 3 我对这种方法有问题,它会导致错误; how can I implement this approach?我该如何实施这种方法?
For example you can see NopCommerce approach in nop 4.2, its similar to mine.例如,您可以在 nop 4.2 中看到 NopCommerce 方法,它与我的类似。 Sorry for my bad English.对不起,我的英语不好。
I find solution.我找到解决方案。 main problem was in IWebHostEnvironment that it solved by framework reference instead of package reference.主要问题是在 IWebHostEnvironment 中,它通过框架引用而不是包引用来解决。
You can add你可以加
<FrameworkReference Include="Microsoft.AspNetCore.App" />
in <ItemGroup> ... </ItemGroup>
and enjoy it.在<ItemGroup> ... </ItemGroup>
享受它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.