我在wwwroot
文件夹下有一些电子邮件模板,这些模板可用于我的EmailService。它可以在本地运行,但是当我将Web应用程序启动到Azure VSTS时出现错误
System.IO.DirectoryNotFoundException:找不到根目录/ app / wwwwroot / Templates
在RazorLight.Razor.FileSystemRazorProject..ctor(字符串根)
csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Contratos" Version="1.0.0-CI-20191001-130431" />
<PackageReference Include="MailKit" Version="2.3.1.6" />
<PackageReference Include="MassTransit" Version="5.5.6-develop.2181" />
<PackageReference Include="MassTransit.Autofac" Version="5.5.6-develop.2181" />
<PackageReference Include="MassTransit.Azure.ServiceBus.Core" Version="5.5.6-develop.2181" />
<PackageReference Include="MassTransit.Extensions.DependencyInjection" Version="5.5.6-develop.2181" />
<PackageReference Include="MassTransit.Extensions.Logging" Version="5.5.6-develop.2181" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.0.0" />
<PackageReference Include="RazorLight" Version="2.0.0-beta1" />
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="wwwroot\StaticFiles\images\common\background.png" />
<_ContentIncludedByDefault Remove="wwwroot\StaticFiles\images\common\bottom-bord
<_ContentIncludedByDefault Remove="wwwroot\StaticFiles\images\common\youtube-logo_3x.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\StaticFiles" />
<Folder Include="wwwroot\Templates" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Contratos\Contratos.csproj" />
</ItemGroup>
</Project>
关于如何解决此问题的任何想法?
更新:如果将其添加到csproj
<ItemGroup>
<Folder Include="wwwroot\Templates\Password" />
<Folder Include="wwwroot\StaticFiles\images" />
</ItemGroup>
错误更改为
项目无法通过键BlockedLogin.cshtml找到模板