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

时间:2023-01-15 17:06:03

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.

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

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

代码在本地(从Visual Studio)完善,但在生产Web服务器上失败,缺少程序集引用错误:

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

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

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.

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

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.

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

6 个解决方案

#1


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

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

#2


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

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

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

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

#3


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.

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

#4


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

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

#5


Does other parts of your ASP.NET site work?

ASP.NET网站的其他部分是否有效?

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

您的站点目标3.5和可能3.5是否未安装在生产服务器上?

#6


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

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

#1


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

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

#2


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

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

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

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

#3


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.

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

#4


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

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

#5


Does other parts of your ASP.NET site work?

ASP.NET网站的其他部分是否有效?

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

您的站点目标3.5和可能3.5是否未安装在生产服务器上?

#6


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

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