vb.net - 为什么 VB.net 4.0 框架应用程序(标准 EXE)会尝试写入 HKLM 中的 ASP.net 注册表项?

标签 vb.net .net-4.0

我编写了一个 .net 4.0 框架应用程序(在 VB.net 中)。这确实是一件简单的事情,基本上只是一个带有一些花哨功能的屏幕保护程序。

但是,它确实使用 .net 的 Web 客户端功能来查询互联网上的各个站点。

但它不是一个网络应用程序。它不在 ASP 下运行,或者据我所知,与 ASP.net 没有任何关系。

但是,当我在安装了 Comodo 防火墙的计算机上运行它时,我会收到来自 Comodo 的警告弹出窗口,表明

1) 程序正在尝试访问互联网(这是一件好事,这里没问题)。

但是

2) 该程序正在尝试创建注册表项,例如: hklm\system\controlset001\services\asp.net_4.0.30319\names{somelonghexvalue}

现在,我一直遵循这样的规则:基本上 HKLM 中唯一困惑的东西是安装程序,但这里这个应用程序试图在那里做一些事情。它来自 .net 框架,我的应用程序根本不从注册表请求任何 key 。

我猜测框架已被授予执行此操作的权限,即使当前用户无权在 HKLM 中创建 key (因为我没有收到任何错误,即使应用程序在具有非常高的凭据的情况下运行)很少的权利)。

所以,我的问题是,有人以前遇到过这个问题,或者知道为什么框架在运行与 ASP.net 无关的标准 EXE 时会创建 ASP.Net 注册表项?

我确实提出了这个问题, ASP.NET 4 registry changes 但该案例中的提问者实际上正在处理 ASP.net 应用程序。在这种情况下,我不是。

--编辑-- 添加了用于执行 HTTP Get 的代码,适用于 Clara

Dim request As HttpWebRequest = DirectCast(WebRequest.Create(requestUri), HttpWebRequest)
Dim resultPage As String = String.Empty
Using httpWebResponse As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)
    Using responseStream As Stream = httpWebResponse.GetResponseStream()
        Using reader As New StreamReader(responseStream)
            resultPage = reader.ReadToEnd()
        End Using
    End Using
End Using

最佳答案

由于某种原因,它正在更新 ASP.NET 性能计数器,尽管我不确定原因。

该注册表项存储 ASP.NET 的命名管道名称:

Pipe names. One per each running worker process. See “What happens at runtime?”. This sub-key appears only on the 32 bit versioned keys.

...

During runtime, whenever a web application is run and the worker process starts, it loads webengine.dll (or webengine4.dll in .Net 4.0). This library, among other many things, will initialize the performance counters local storage in the process. It will also create a named pipe to which clients will be able to connect and read the counters data from. The name of the pipe is stored in the HKLM\SYSTEM\CurrentControlSet\services\ASP.NET_x.x.xxxxx\Names registry key, so clients can find it.

The processing of the named pipe is asynchronous. The library uses an IO completion thread from the CLR, which wakes up every time

引用文献:

ASP.NET Internals - Performance counters implementation details

关于vb.net - 为什么 VB.net 4.0 框架应用程序(标准 EXE)会尝试写入 HKLM 中的 ASP.net 注册表项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10466720/

相关文章:

vb.net - 在组合框 VB.NET 中禁用鼠标滚轮

wpf - ICommand CanExecuteChanged 未更新

c# - 我在哪里可以找到一个功能来改变我现在的样子?

c# - WPF DotNET 应用程序将在 Debug模式下运行,但 .EXE 将不会运行

c#-4.0 - 在 .NET 上实现 DSL

silverlight - nuget:仅为特定目标框架指定依赖项

c# - 返回 Task 的方法应该抛出异常吗?

c# - 使用 selenium 下载没有直接 URL 的文件

vb.net - vb.net 中的形状控制

c# - 如何在不修改网页浏览器控件中的文档的情况下注入(inject)并执行javascript函数?