找不到ASP.NET服务引用 [英] ASP.NET Service Reference could not be found
问题描述
嗨朋友们。
请帮我解决这个问题,我已经搜索了一天但是我无法解决它!
我使用Visual Studio 2012,ASP.NET,c#。
我创建了新网站(不是网络项目),
在解决方案资源管理器中右键单击项目并单击添加服务引用
然后我添加了一个Web服务提供者地址,一个新文件夹已命名为 App_WebReferences 。它包含ServiceReference1文件夹,其中有三个文件(两个.svcinfo和一个.wsdl)。
现在我使用此代码作为我的提供者指导:
Hi friends.
please help me with this problem, i've searched it for a day but i couldn't solve it!
I use Visual Studio 2012, ASP.NET, c#.
I've created new website ( not web project ),
In solution explorer right click on project and clicked Add Service Reference
then I've add a web service provider address, a new folder named App_WebReferences created. It contains ServiceReference1 folder in which there are three files(two .svcinfo and one .wsdl).
Now I use this code as my provider guided:
var srv = new ServiceReference1.PaymentIFBindingSoapClient();
double result = srv.verifyTransaction(refNum, "10004738");
编译时没有错误并在localhost中运行。
$ b当我将我的网站文件上传到服务器上的ftp时,$ b但是
.. 我收到此错误信息:
there is no error in compilation and running in localhost.
BUT
when I upload my website files to my ftp on the server..I get this error message:
*Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
**Compiler Error Message:** CS0246: The type or namespace name 'ServiceReference1' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 69: ///WebService Instance
Line 70: //
Line 71: var srv = new ServiceReference1.PaymentIFBindingSoapClient();
Line 72:
Line 73: double result = srv.verifyTransaction(refNum, "10004738");
Source File: d:\domains\olomrayaneh.net\wwwroot\ebook\check_payment.aspx.cs Line: 71
Show Detailed Compiler Output:
Show Complete Compilation Source:
Version Information: Microsoft .NET Framework Version:2.0.50727.3643; ASP.NET Version:2.0.50727.3634*
我遇到了这个问题。
问题是什么!?
我该如何解决?
请帮助我!!
我应该说我试图添加这一行:
I've stuck in this problem.
Whats the problem!?
How should I solve it?
PLEASE help me !!
I should say that I tried to add this line:
using ServiceReference1;
然后错误消息行改为此行并显示相同的消息!
并且localhost运行中再次没有错误消息!
我的网站内置.Net Framework 3.5
提前谢谢。
then the error message line changes to this line with the same message !
and again no error message in localhost running!
my website is build in .Net Framework 3.5
thanks in advance.
推荐答案
谢谢各位朋友。我已经解决了。
问题是我将所有数据复制到wwwroot文件夹下的子文件夹中,
但我应该将 App_WebReference 文件夹复制到wwwroot文件夹的根目录!
Thanks friends. I've solved it.
the problem was that I was copied all data to a subfolder under the wwwroot folder,
But I should copy the App_WebReference folder to the root of wwwroot folder !
这篇关于找不到ASP.NET服务引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!