Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:

C#
var srv = new ServiceReference1.PaymentIFBindingSoapClient();
    double result = srv.verifyTransaction(refNum, "10004738");


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:

C#
*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:

C#
using ServiceReference1;


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.
Posted
Updated 8-Jan-18 10:26am
Comments
vinayraghavendra.hs 24-Apr-13 0:30am    
I am not sure change the framework to 4.0 and see
Mohamad77 24-Apr-13 0:37am    
thanks for comment but I get this error in 4.0 framework:
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Line 29: <compilation debug="true" targetframework="4.0">
Mohamad77 24-Apr-13 0:37am    
Line 29: compilation debug="true" targetFramework="4.0"
Naz_Firdouse 24-Apr-13 1:18am    
Check whether IIS is configured to run framework 4.0 or not.
set it to 4.0

1 solution

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 !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900