在生产 (IIS) 服务器上的 ASP.NET 上使用 Web 服务时出现问题

发布于 2024-07-27 02:06:58 字数 530 浏览 4 评论 0原文

我们已经在 ASP.NET 站点上实现了一些调用远程服务的 SOAP 客户端代码。 实现基本上是通过使用 Visual Studio“添加 Web 引用”向导、向代码中添加适当的“using remote.service.namespace”并调用服务来完成的。

代码在本地运行完美(来自 Visual Studio),但在生产 Web 服务器上失败,并出现缺少程序集引用错误:

CS0246:找不到类型或命名空间名称“remote.service”(是否缺少 using 指令或程序集引用?)

我偷偷怀疑我没有正确部署所有内容,也许有人可以指出什么是我在那里失踪了?

谢谢!

其他信息:

项目是一个网站。

ASP.NET 2.0 版已安装并用作开发盒和生产服务器上的目标。

WSDL.exe 生成的代理文件部署到网站的根文件夹中,即页面所在的文件夹中。 全局命名空间(默认)用于代理类生成。

We've implemented some SOAP client code on our ASP.NET site that calls up a remote service. Implementation was basically done by using Visual Studio "Add Web Reference" wizard, adding proper 'using remote.service.namespace' to the code and calling the service.

Code works perfect locally(from Visual Studio), but fails on production web server with missing assembly reference error:

CS0246: The type or namespace name 'remote.service' could not be found (are you missing a using directive or an assembly reference?)

I have a sneaky suspicion that I am not deploying everything properly, maybe some one can point out what is that I am missing there?

Thanks!

Additional info:

Project is a Website.

ASP.NET version 2.0 installed and used as a target on both dev box and production server.

Proxy file generated by WSDL.exe is deployed into the root folder of the website, same folder where the page resides. Global namespace(default) was used for proxy class generation.

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

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

发布评论

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

评论(6

一向肩并 2024-08-03 02:06:58

如果这是一个网站项目,则代理文件应驻留在 App_Code 文件夹内

If this is a WebSite project, then the proxy file should reside inside the App_Code folder

怕倦 2024-08-03 02:06:58

您提到代理 dll 放置在“页面所在的网站的根文件夹”中。

您应该将 dll 放在“bin”文件夹中。 如果该文件夹不存在,请创建它。

You mentioned the proxy dll is placed on "the root folder of the web site, where the page resides".

You should place the dll inside the "bin" folder. If the folder is not there create it.

倾城花音 2024-08-03 02:06:58

.NET 中的 Web 服务客户端堆栈在运行时生成代理客户端(根据 wsdl.exe/svcutil.exe 生成的类中的注释)。 这个生成的文件通常最终位于您的服务器临时目录之一(主 Windows 树下的某处有一个)。 问题是 ASP.NET 用户帐户无权写入此特定临时目录,但在写入文件时没有注意到,因此在尝试加载生成的文件时最终会出现错误文件返回。 根据服务器上的确切安装顺序,您最终可能会遇到这种情况。 一旦找到正确的目录,您只需修复该目录的 NTFS 权限即可解决问题。

The Web Service client stack in .NET does runtime generation of the proxy client (from the annotations in the class generated by wsdl.exe/svcutil.exe). this generated file typically ends up in one of your servers temp directories (there's one under the main windows tree somewhere). The problem is that the ASP.NET user account doesn't have rights to write to this particular temp directory, but doesn't notice at the time it writes the file, so you end up with an error with it trying to load the generated file back. You can end up in the situation depending on the exact installation order on your server. Once you find the right directory you can simply fix the NTFS perms on the directory to solve the problem.

神仙妹妹 2024-08-03 02:06:58

您是否将 App_WebReferences 文件夹及其所有内容复制到服务器?

Did you copy the App_WebReferences folder and all its contents to the server?

无人问我粥可暖 2024-08-03 02:06:58

您的 ASP.NET 站点的其他部分可以工作吗?

您的站点是否以 3.5 为目标,并且生产服务器上可能未安装 3.5?

Does other parts of your ASP.NET site work?

Does your site target 3.5 and possibly 3.5 is not installed on the production server?

揽月 2024-08-03 02:06:58

这是一个网站,还是一个 Web 应用程序项目? 我打赌这是一个网站。

Is this a Web Site, or a Web Application Project? I bet it's a Web Site.

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