通过网络运行 .net 应用程序

发布于 2024-08-25 19:00:25 字数 430 浏览 9 评论 0原文

我需要使 .NET 应用程序能够在网络共享上运行,问题是这将位于客户端的网络共享上,因此路径不会相同。

我快速浏览了 ClickOnce 和 Visual Studio 2008 中的发布选项,但它需要特定的网络共享位置 - 并且我假设该位置在执行操作时存储在某个位置。

目前,该工作是使用旧的 VB6 应用程序完成的,因此可以解决所有这些安全问题,但该应用程序编写得很差,几乎无法维护,因此确实需要放弃。

是否可以将域控制器设置为允许执行该特定的 .NET 应用程序?任何其他选择都会受到欢迎,因为我希望这个小应用程序对业务非常关键。

我应该说,客户端网络是学校,因此通常与客户端计算机一样被完全锁定,因此手动向每个客户端计算机添加例外是一个很大的禁忌。


抱歉,我忘了提及我们目前仅限于 .NET 2.0,我们计划将其升级到 4.0,但这不会立即发生。

I need to enable a .NET application to run over a network share, the problem is that this will be on clients' network shares and so the path will not be identical.

I've had a quick look at ClickOnce and the publish options in Visual Studio 2008 but it needs a specific network share location - and I'm assuming this location is stored somewhere when it does its thing.

At the moment the job is being done with an old VB6 application and so gets around all these security issues, but that application is poorly written and almost impossible to maintain so it really needs to go.

Is it possible for the domain controller to be set up to allow this specific .NET application to execute? Any other options would be welcomed as I want to get this little application is very business critical.

I ought to say that the client networks are schools, and thus are often quite locked down as are the client machines, so manually adding exceptions to each client machine is a big no no.


Apologies, I forgot to mention we're restricted to .NET 2.0 for the moment, we are planning to upgrade this to 4.0 but that won't happen immediately.

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

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

发布评论

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

评论(5

病毒体 2024-09-01 19:00:25
  1. 在项目属性的“发布”选项卡上有一个“安装文件夹 URL”文本框。 Visual Studio 要求您在其中放置一些内容。只需输入任意随机 UNC 路径 (\\someserver\randomfolder)
  2. 单击“选项”按钮。选择“清单”并选中“排除部署提供程序 URL”。这将删除您在步骤 1 中被迫添加的路径。

这将允许客户将您的部署放置在他们想要的任何位置。当用户安装时,他们的开始菜单快捷方式将指向他们放置部署的位置。

以下是 MSDN 关于该复选框的描述...

排除部署提供商 URL
指定是否排除
部署提供商 URL 来自
部署清单。开始于
Visual Studio 2008 SP1、部署
提供商 URL 可以排除在外
清单中的场景
应用程序更新应该来自
地点未知
初次出版。之后
申请已发布,更新将
从任何地方进行检查
应用程序是从安装的。

  1. On the "Publish" tab of your project properties there is a "Installation Folder Url" textbox. Visual Studio requires you to put something there. Just put in any random UNC path (\\someserver\randomfolder)
  2. Click the "Options" button. Select "Manifests" and check "Exclude deployment provider URL". This will remove the path you were forced to add in step 1.

This should allow clients to put your deployment wherever they want. When their users install, their start menu shortcut will point back to where they put the deployment.

Here's the description from MSDN about that checkbox...

Exclude deployment provider URL
Specifies whether to exclude the
deployment provider URL from the
deployment manifest. Starting in
Visual Studio 2008 SP1, the deployment
provider URL can be excluded from the
manifest for scenarios in which
application updates should come from a
location unknown at the time of the
initial publication. After the
application is published, updates will
be checked from wherever the
application is installed from.

无人问我粥可暖 2024-09-01 19:00:25

清单中的部署位置必须与其部署位置相匹配。您将必须使用 UNC 路径。这个应该没有什么问题。 ClickOnce 应用程序安装在用户的配置文件下,不需要管理权限。它只需要对部署应用程序的文件共享进行读取访问。

最好的答案是为每所学校创建部署并让您设置 UNC 路径,因为这样您只需向他们发送签名的部署,他们就可以将其放在文件共享上。但如果涉及很多学校,那就是一个大问题了。

下一个答案是:谁实际将应用程序部署到每个学校,即将其放在文件共享上?有某种管理员吗?

我建议(取决于是谁)给他们 mageUI.exe 并教他们如何更改部署 URL 并重新签署清单(它会提示)。他们重新签署部署的问题是他们必须拥有证书。您可以为每所学校提供自己的证书(使用 VS 中的“创建测试证书”按钮创建,或使用 MakeCert 创建一个 [询问您是否需要更多信息])或为它们提供相同的密钥(不是很安全,但是嘿,它会起作用)。

如果您至少更新到 .NET 3.5 SP-1,则无需签名即可部署该应用程序。 (我并不是在 .NET 2.0 方面为难您,我的公司也处于同样的境地,我只是传递此信息。)

如果计算机可以访问互联网,您可能会找到一个地方来托管部署10 美元/月,并将其推送到网络服务器并让它们全部从那里安装。然后每个人都会同时获得更新,您只需将更新部署到一个位置。假设他们可以访问互联网,这将是最简单的解决方案。

The deployment location in the manifest must match the location where it is deployed. You are going to HAVE to use a UNC path. There shouldn't be any problem with this. ClickOnce applications install under the user's profile, and require no administrative privileges. It only needs read access to the file share where the application is deployed.

The best answer is to create deployments for each school and for you to set the UNC path, because then you can just send them a signed deployment and they can put it on the file share. But that's a major p.i.t.a. if there are a lot of schools involved.

The next answer is: Who actually deploys the application to each school, i.e. puts it on the file share? Is there some kind of administrator?

What I would recommend (depending on who it is) is giving them mageUI.exe and teaching them how to change the deployment URL and re-sign the manifest (it will prompt). The problem with them re-signing the deployment is they have to have a certificate. You could give each school their own certificate (created with the "create test certificate" button in VS, or use MakeCert to create one [ask if you want more info]) or give them all the same key (not very secure, but hey, it would work).

If you at least updated to .NET 3.5 SP-1, you could deploy the application without signing it. (I'm not giving you a hard time about .NET 2.0, my company is in the same position, I'm just passing this information on.)

If the computers have internet access, you could probably find somewhere to host the deployment for $10/month, and push it to a webserver and let them all install from there. Then everyone would get updates at the same time, you would only have to deploy updates to one location. This would be the simpliest solution, assuming they have internet access.

迷你仙 2024-09-01 19:00:25

也许,这里的链接可以拯救你,如果我没记错的话,你担心驱动器号和处理 UNC 约定吗?在 CodeGuru 上查看此内容,其中包含有关如何在运行时动态映射到 UNC 共享的代码。

Perhaps, the link here could save you, if I am not mistaken, you are worried about the drive letter and handling UNC conventions? Take a look at this on CodeGuru, which contains code on how to map to a UNC share dynamically at run-time.

私野 2024-09-01 19:00:25

问题是与 .Net 框架相关的安全性。不幸的是,我在这方面没有太多经验,但也许这些链接之一会有所帮助:

The problem is Security related to the .Net framework. Unfortunately i don't have much experience in this area, but maybe one of these links will help:

如梦亦如幻 2024-09-01 19:00:25

可以使用 UNC 路径吗?

\\\server\folder\app.exe?

Can you use a UNC path?

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