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

发布于 2024-08-07 00:06:28 字数 2440 浏览 6 评论 0原文

在开发 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 加密被禁用了,所以我有点不知所措。

Working on a an ASP.NET MVC Project, and I'm having some difficulties deploying to a shared dev server.

Locally, when debugging using the local Visual Studio 2008 server, everything works peachy. However, once deployed, I receive the following error:

    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 

In the error log:

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: 

After finding the deployment error, I tried adding an application locally, and that seems to result in the same application.

On my local dev machine, I'm using Windows 7 RTM (x64), and on the shared server I'm running Windows Server 2008 Standard (x86).

Poked around, and my FIPS encryption in Local Security Policy is disabled, so I'm at a bit of a loss.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

失而复得 2024-08-14 00:06:28

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

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

I had some issues in the past when developing on a x64 and deploying to a x86 environment. Under the platform target are you compiling to "Any CPU", x86 or x64?

Try compiling directly to x86 and see if that gives helps.

心安伴我暖 2024-08-14 00:06:28

您是否使用 这里?如果是这样,您需要使用不同的 dll 名称来构建它(例如,将其构建为 BCryptNet.dll)

问题是 Vista/Windows 2008 中有一个新的 Windows API 会尝试加载 bcrypt.dll,并且如果您有bcrypt.dll 在您的 Web 应用程序 bin/ 目录中找不到系统 dll。

Are you using Bcrypt.net from here? If so you need to build it with a different dll name (so for example build it as BCryptNet.dll)

The problem is that there is a new windows API in Vista/Windows 2008 that tries to load bcrypt.dll and if you have a bcrypt.dll in your web app bin/ directory it can't find the system dll.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文