发布后无法加载asp.net图像

Jas*_*Lie 3 .net c# asp.net image loading

发布应用程序后,我的图像将无法加载。当我调试时它们会加载。知道什么会导致这个问题吗?

<a class="navbar-brand" href="@Url.Action("SearchQuery", "Search")"><img id="logo" src="~/Images/Logo.png"/></a>
Run Code Online (Sandbox Code Playgroud)

Ble*_*ose 5

添加要发布的图像的步骤:

1) 右键单击​​图像文件夹并选择“包含在项目中”

包含在项目中

2) 现在您应该在图像的属性上看到构建操作:内容

在此处输入图片说明


Wil*_* Jr 1

尝试在 src 属性上使用 Url.Content :

src="@Url.Content("~/Images/Logo.png")"
Run Code Online (Sandbox Code Playgroud)