|
-
Feb 2nd, 2012, 05:52 AM
#1
Thread Starter
Fanatic Member
Adding reference to web service creates build problem
I have a number of .Net web sites built in VS2010 using Framework 4.0that reference a web service to send emails.
My most recent site I created as a web application as opposed to a web site. In the Solution Explorer you can add a 'Service Reference' and, if you click the Advanced button you can then add a reference to a web service.
I did that and now the (web application) site won't build - it says it cannot load the Ajax dll. If I remove the reference to the web service, the site builds okay - if I add the reference back in, the site will not build.
Hmmm, do I need to abandon the idea of using a 'Web Application' and turn it into a 'Web Site'?
Thanks for any help.
-
Feb 3rd, 2012, 04:42 PM
#2
Re: Adding reference to web service creates build problem
 Originally Posted by Webskater
Hmmm, do I need to abandon the idea of using a 'Web Application' and turn it into a 'Web Site'?
You certainly shouldn't need to, no.
If you add the service reference to a Web Site Project, does it work? Is there anything in the web methods that you are exposing that takes a dependency on something in the AJAX Dll?
Gary
-
Feb 4th, 2012, 05:49 AM
#3
Thread Starter
Fanatic Member
Re: Adding reference to web service creates build problem
 Originally Posted by gep13
If you add the service reference to a Web Site Project, does it work?
Gary
Yes, the web service is currently used by 4 web site projects
 Originally Posted by gep13
Is there anything in the web methods that you are exposing that takes a dependency on something in the AJAX Dll?
Gary
The web methods take a single parameter - an EmailID - which is used to retrieve the data for the email (subject, message, list of recipients etc.) from a database and which then sends the emails using SmtpClient
The only reference to Ajax I can see is this (which is put there by default when you create the web service in Visual Studio):
Code:
//To allow this web service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
In the applications that call the web service - the call is done in a btnSendEmail_Click event.
The data is saved to the database and the web service is called by doing this:
Code:
CPWebService.Service1 myMailService = new CPWebService.Service1();
myMaiilService.SendEPMailsAsync(EmailID);
-
Feb 4th, 2012, 06:38 AM
#4
Re: Adding reference to web service creates build problem
Ok, you shouldn't "have" to do this, but if you add a reference to the Ajax DLL in the Web Application, does it then build?
Gary
-
Feb 4th, 2012, 08:22 AM
#5
Thread Starter
Fanatic Member
Re: Adding reference to web service creates build problem
 Originally Posted by gep13
Ok, you shouldn't "have" to do this, but if you add a reference to the Ajax DLL in the Web Application, does it then build?
Gary
The web application project uses Ajax so there is a reference to the Ajax dll in the web application.
Just for a laugh I added a reference to the Ajax dll in the web service and published it again - made no difference though. So have removed that reference from the web service.
-
Feb 4th, 2012, 09:56 AM
#6
Re: Adding reference to web service creates build problem
I am lost to explain what is going on, sorry.
-
Feb 4th, 2012, 12:20 PM
#7
Thread Starter
Fanatic Member
Re: Adding reference to web service creates build problem
 Originally Posted by gep13
I am lost to explain what is going on, sorry.
Thanks for having a look - I'll have to start with a new Hello World web service and see if adding a reference to that prevents my web application from building.
At times like this - I yearn for the old days of asp. Life seemed a lot more simple then.
-
Feb 7th, 2012, 02:28 AM
#8
Re: Adding reference to web service creates build problem
That is a good plan. Back to basics, and work from there.
Ha ha, I know what you mean. However, if I never see another Classic ASP application, it will be too soon 
Gary
-
Feb 7th, 2012, 04:09 AM
#9
Thread Starter
Fanatic Member
Re: Adding reference to web service creates build problem
 Originally Posted by gep13
That is a good plan. Back to basics, and work from there.
Ha ha, I know what you mean. However, if I never see another Classic ASP application, it will be too soon
Gary
I've still got one running, used by quite a lot of businesses - that I have to support and develop. Sometimes I don't touch it for months at a time, then, when I need to do something I think 'oh, no, back to debugging with Response.Write and Response.End' .... then, I make a few changes, click 'Save' and refresh the browser .... wow, no building, no 'build errors', no waiting forever for a build to take place ... hmmm, it had its merits too.
And you never seemed to get these weird inexplicable things you get in .Net sometimes.
-
Feb 9th, 2012, 02:40 AM
#10
Re: Adding reference to web service creates build problem
It's a tough one, I agree.
ASP.Net has it's problems, but then so does Classic ASP. You are working/adding to an existing application, that you know and understand. Can you imagine creating a new ASP application, from scratch, without all the stuff you now take for granted in the .Net World? 
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|