无法在wwwroot下获取图像以在剃须刀页面上工作

时间:2020-02-06 22:17:40

标签: c# .net

我试图在我的剃须刀页面上显示一些图像,但无法正常工作,如果我在浏览器上输入localhost:5000 / StaticFiles / images / facebook-logo.png我得到了图像,但在剃须刀页面中无法正常工作

@page
@model MRV.ServicoEmail.wwwroot.Templates.Password.Teste

@{
    var apiPath = "localhost:5000";
    var imagePath = apiPath + "/StaticFiles/";
    var faceLogoPath = imagePath + "images/facebook-logo.png";
    var instaLogoPath = imagePath + "images/instagram-logo.png";
    var youtubeLogoPath = imagePath + "images/youtube-logo.png";
    var mrvLogoPath = imagePath + "images/logo-mrv-mobile.png";
}

<!DOCTYPE html>

<html>
<head>
    <title></title>
</head>
<body>
<div>
    <a target="_blank"
    href="https://www.facebook.com/MRV/?__tn__=%2Cd%2CP-R&eid=ARDBMDPzUxYK-RbC0Y1zHzfgjfRSzSWwFllWarHmbHlBY47Wx6dHeceofIxpPezuY1oU1nV3LPO1TWLr"
    style="text-decoration: none;"><img border="0" vspace="0" hspace="0" style="padding: 0; margin: 0; outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; border: none; display: inline-block;
                                    "
    alt="Facebook" title="Facebook"
    width="35" height="35"
    src="@faceLogoPath"></a>
</div>
</body>
</html>

关于我缺少什么的任何想法?

编辑:我已经有

 app.UseStaticFiles(new StaticFileOptions()
            {
                OnPrepareResponse = context =>
                {
                    context.Context.Response.Headers.Add("Cache-Control", "no-cache, no-store");
                    context.Context.Response.Headers.Add("Expires", "-1");
                }
            });

启动时

0 个答案:

没有答案