c# - MVC 应用程序可以在 Visual Studio 中运行,但不能在 IIS7 中运行

标签 c# iis-7 cassini fips

正在开发 ASP.NET MVC 项目,并且在部署到共享开发服务器时遇到一些困难。

在本地,使用本地 Visual Studio 2008 服务器进行调试时,一切正常。但是,部署后,我收到以下错误:

    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.## Heading ##

Parser Error Message: Unable to find an entry point named 'BCryptGetFipsAlgorithmMode' in DLL 'bcrypt.dll'.

Source Error:

Line 1:  <%@ Application Codebehind="Global.asax.cs" Inherits="APPLICATION_NAME.Web.MvcApplication" Language="C#" %>


Source File: /APPLICATION_NAME/global.asax    Line: 1

Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927 

在错误日志中:

Event sequence: 1 
Event occurrence: 1 
Event detail code: 0 

Application information: 
    Application domain: /LM/W3SVC/1/ROOT/APPLICATION_NAME-4-128995312096183595 
    Trust level: Full 
    Application Virtual Path: /APPLICATION_NAME 
    Application Path: E:\PROJECTS\APPLICATION\APPLICATION_NAME\APPLICATION_NAME\app\APPLICATION_NAME.Web\ 
    Machine name: PC

Process information: 
    Process ID: 4608 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL\DefaultAppPool 

Exception information: 
    Exception type: HttpException 
    Exception message: Unable to find an entry point named 'BCryptGetFipsAlgorithmMode' in DLL 'bcrypt.dll'. 

Request information: 
    Request URL: http://localhost/APPLICATION_NAME 
    Request path: /APPLICATION_NAME 
    User host address: ::1 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: IIS APPPOOL\DefaultAppPool 

Thread information: 
    Thread ID: 6 
    Thread account name: IIS APPPOOL\DefaultAppPool 
    Is impersonating: False 
    Stack trace:    at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
   at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)


Custom event details: 

发现部署错误后,我尝试在本地添加一个应用程序,这似乎会产生相同的应用程序。

在我的本地开发计算机上,我使用 Windows 7 RTM (x64),在共享服务器上我运行 Windows Server 2008 Standard (x86)。

查了一下,我的本地安全策略中的 FIPS 加密被禁用了,所以我有点不知所措。

最佳答案

过去,我在 x64 上进行开发并部署到 x86 环境时遇到了一些问题。在平台目标下,您是编译为“任何 CPU”、x86 还是 x64?

尝试直接编译到 x86,看看是否有帮助。

关于c# - MVC 应用程序可以在 Visual Studio 中运行,但不能在 IIS7 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1541627/

相关文章:

iis-7 - 使用 Inno Setup 安装 IIS

.net - 禁用 Visual Studio 开发服务器 - 每个项目都有什么方法可以做到这一点?

c# - asp.net 网站(开发)第一次加载需要很长时间(C#/Visual Studio 2012)

c# - 使用 Entity Framework 执行自定义sql?

c# - 列样式在 TableLayoutPanel 上不起作用

asp.net - 如何在IIS7中禁用应用程序池空闲超时?

asp.net - 为 CAC 卡配置 'Cassini'(ASP.NET 开发服务器)以进行测试 - 如何?

c# - 关于将 WCF 托管为 Windows 服务的问题

asp.net - HTTP 错误 403.14 - 访问网站时出现禁止错误