Popular blog tags

1.add <MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>

G:\Nopcommerce\wwwstocksocom\src\Presentation\Nop.Web\Nop.Web.csproj

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
  </PropertyGroup>
  
  <ItemGroup>

    <PackageReference Include="NEST" Version="6.0.1" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\..\Libraries\Nop.Core\Nop.Core.csproj" />
    <ProjectReference Include="..\..\Libraries\Nop.Data\Nop.Data.csproj" />
    <ProjectReference Include="..\..\Libraries\Nop.Services\Nop.Services.csproj" />
    <ProjectReference Include="..\..\Modules\Nop.Modules.Translate\Nop.Modules.Translate.csproj" />
    <ProjectReference Include="..\Nop.Web.Framework\Nop.Web.Framework.csproj" />
  </ItemGroup>

</Project>

 

Nop.Web:add appsettings.json

Nop.Web:add read IWebHostEnvironment

Nop.Web:注入配置信息,绑定到类

 

Nop.Web:DI注入容器

 

配置跨域处理,添加 CORS 策略:图片上传要用到