如何检查是否已在ASP.NET 4中注册以在IIS 7.5中运行? [英] How can I check whether with ASP.NET 4 is registered to run in IIS 7.5?

查看:141
本文介绍了如何检查是否已在ASP.NET 4中注册以在IIS 7.5中运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查ASP.NET 4是否已注册以在IIS 7.5中运行?

How can I check whether with ASP.NET 4 is registered to run in IIS 7.5?

除了运行

aspnet_regiis -i

从框架的文件夹中.

我不需要通过编程方式进行检查,仅通过IIS管理器或推荐行即可.我有一个.NET页面正在重现500错误,我确定这是由于ASP.NET 4未向IIS注册.

I don't need to check this programmatically, just via IIS Manager or the commend line. I have an .NET page that is returing a 500 error, which I have determined could be due to ASP.NET 4 not being registered with IIS.

但是,在确定服务器配置之前,我想确定一下.

However, I want to be certain before I make changes to the server configuration.

推荐答案

尝试使用参数-lv(即:

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -lv

这将为您提供以下输出:

This will give you the following output:

Microsoft (R) ASP.NET RegIIS version 4.0.30319.34209
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation.  All rights reserved.
2.0.50727.0             C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll
4.0.30319.0             C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll
4.0.30319.0             C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll

在此示例中,您可以看到安装了32位和64位dll的v4.0.30319.0. 要安装最新版本(例如,在应用.NET Framework更新后),请使用

In this example, you can see that v4.0.30319.0, 32 and 64 bit dll's, are installed. To install the latest version, for example after applying a .NET Framework update, use

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -iru

注意:在 64位IIS服务器上,您需要在上面的路径中使用"Framework64" 而不是"Framework".奇怪的是,我发现有些服务器在工作路径上具有64位"Framework"的服务器上工作,而在另一些服务器上我不得不使用"Framework64",只需尝试一下即可.如果注册不起作用,请在路径中使用"Framework64"再次运行它,这不会造成损害.在一种情况下,我不得不使用cd C:\Windows\Microsoft.NET\Framework更改路径,然后键入aspnet_regiis -iru使其最终生效.

Note: On 64 bit IIS servers, you need to use "Framework64" instead of "Framework" in the paths above. Strangely, I found on some servers with 64 bit "Framework" in the path worked, on others I had to use "Framework64" - simply try it out. If the registration does not work, run it again with "Framework64" in the path, it does not harm. In one case, I had to change the path using cd C:\Windows\Microsoft.NET\Framework, then I typed aspnet_regiis -iru to make it finally work.

您提到您需要以编程方式进行检查:上面的命令可以在批处理文件中使用,并且可以通过(前提是您使用"aspnet_regiis -lv> outputfile.txt"将输出写入文本文件).

You mentioned that you need to check it programmatically: The command above can be used in a batch file, and via this article you can find the string "4.0.30319.0" in the output (provided you're using "aspnet_regiis -lv > outputfile.txt" to write the output into a text file).

这篇关于如何检查是否已在ASP.NET 4中注册以在IIS 7.5中运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆