从项目文件夹中的Razor中获取图像

我有一个API项目,其中我使用Razor模板生成pdf

这是项目结构

从项目文件夹中的Razor中获取图像

我在Staticfiles中包括了Startup.cs

app.UseStaticfiles();
        app.UseStaticfiles(new StaticfileOptions()
        {
            FileProvider = new PhysicalFileProvider(
                Path.Combine(Directory.getcurrentDirectory(),@"Images")),RequestPath = new PathString("/Staticfiles")
        });

在剃刀模板中,我尝试像这样使用它

<img class="logo"
     height="80"
     src="@ViewData["BaseUrl"]/Images/propertyLogo-dark.png"/>

但是在pdf图像中不可见,就像在此路径下不可见。

我的问题在哪里?

zhy1234567 回答:从项目文件夹中的Razor中获取图像

"@ViewData["BaseUrl"]/Images/propertyLogo-dark.png" // should be /StaticFiles/ instead Images
本文链接:https://www.f2er.com/3124388.html

大家都在问