www.demo.net/images/1.jpg
当我在我的网站上接近 jpg 图像时,它给了我错误:
Server Error in '/' Application.
There is no build provider registered for the extension '.jpg'. You can register one in the <compilation><buildProviders> section in machine.config or web.config.
这是一个 asp.net mvc 4 站点。它在本地主机上工作,但在托管服务器上失败。
所以我将其修改为
<compilation debug="true" targetFramework="4.5">
<buildProviders>
<remove extension=".jpg"/>
<add extension=".jpg" type="System.Web.Compilation.WebHandlerBuildProvider"/>
</buildProviders>
</compilation>
图像仍未显示,错误变得疯狂。
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The page must have a <%@ webhandler class="MyNamespace.MyClass" ... %> directive.
Source Error:
Line 1: ÿØÿàJFIFHHÿá
Line 2: ExifMM* †Œ1˜2žÿ‡i²ˆ%VêzêAppleiPhone 3GS4.3.52012:10:27 14:22:05‚šü‚ˆ"ˆ'P0221 ‘’4’<’’ ’
Line 3: D’L’‘00’’00 0100 ¢ÿÿ¤è¤¤¤
Source File: /images/1.jpg Line: 1
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18045