Last post Dec 10, 2011 04:26 AM by sujeet_kumar
Dec 08, 2011 10:00 PM|sumu456|LINK
I've created a WCF project and hosted successfully in IIS 7.0 . When I browse to my service using the url
http://localhost:8000/MyService/Service.svc the form is displayed.
Then in my website I add a service reference(MyServiceRefernce) using the above URL. The WCF exposes objects which is used by the client.
In my pages I import the namespace "using MyServiceRefernce" and call the methods on the proxy which returns the object.
client = new
c = client.GetContact(contactId);
When I build my application and run from VS 2010 , everything runs fine. But when I run from IIS i get the following 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 'MyServiceReference' could not be found (are you missing a using directive or an assembly reference?)
The website uses forms-based authentication .
Please help me fix this error. I am in urgent
Dec 08, 2011 10:38 PM|PiyushJo|LINK
Looks like some kind of misspelling somewhere in your code - the error message says "MyServiceReference" and your code says "MyServiceRefernce" - note the missing e. Thanks.
Dec 09, 2011 12:18 AM|sumu456|LINK
That was a typo.
Dec 09, 2011 02:07 AM|sumu456|LINK
Experts please help me to resolved this error.
The service reference is "MyServiceRefernce", then why do i get the compilation error.
Dec 09, 2011 05:47 AM|PiyushJo|LINK
Have you tried to regenerate the service reference? You can also click the generated service reference, then click Show All files and then go to Reference.cs to see the exact namespace and class names you need to use to instantiate the proxy. I am guessing
you refreshed the service reference which caused some changes. If it still doesn't work - send me your client code with generated service reference at
email@example.com and I'll take a look. Thanks.
Dec 09, 2011 03:58 PM|sumu456|LINK
This is what I noticed. My project is a website project. When I deploy under the default website , i get the compilation error that it is not able to find the WCF Namespace.
But when I add the website under the Sites folder and give a new port number, the project works fine.http://localhost:8050/UserLogin.aspx.
How do i get it working under the default web site. I do not want to use the port number in the URL.
Dec 09, 2011 04:14 PM|sumu456|LINK
The issue is similar to the one discussed in this thread
Dec 09, 2011 10:16 PM|sumu456|LINK
I finally managed to get the website up and running. But still it does not work correctly.
Everything works fine when browse through localhost (http://localhost/appname/userlogin.aspx)
But when i browse the website using the machine name(http://servername/appname/userlogin.aspx) it directs me to the login page. I get authenticated and redirected to the default page. The menu links does not work any more.
I do not get any error .
Please help me troubleshoot the problem.
Dec 10, 2011 04:26 AM|sujeet_kumar|LINK
see this link , it is help full.