如何直接从类似于 ASHX 处理程序的 WCF 服务提供文件和 html?

发布于 2024-09-29 10:21:45 字数 399 浏览 0 评论 0 原文

我正在为 Intranet 应用程序编写安装和更新服务器,我希望用户能够直接从以下 URL 安装应用程序: http://domain.local/myapp/install.exe 此请求由我的服务处理。

我还希望能够在例如 http://domain.local/myapp/ 上提供一些基本的 HTML status.html 由我的 WCF 服务动态生成。

这可能吗?我在 WS2008R2 上使用带有 .NET4/VS2010 的自托管 WS 绑定 WCF 服务。

Im writing an install and update-server for an intranet-application and I want the user to be able to install the app directly from a url such as: http://domain.local/myapp/install.exe where this request is handled by my service.

I also would like to be able to serve some basic HTML on for instance http://domain.local/myapp/status.html which is generated on the fly by my WCF-service.

Is this possible? Im using a self-hosted WS-binding WCF-service with .NET4/VS2010 on WS2008R2.

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

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

发布评论

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

评论(1

嘿哥们儿 2024-10-06 10:21:45

我找到了解决方案! System.ServiceModel.Web 中的 WebGet。我必须将项目目标从 .NET 4 Client 更改为 .NET 4,以便 System.ServiceModel.Web.dll 出现在“添加引用”中

Ive found the solution! WebGet in System.ServiceModel.Web. I had to change the project target from .NET 4 Client to .NET 4 for the System.ServiceModel.Web.dll to turn up in "add reference"

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