console application need rebuild and deploy again after dependent project changed? - c#

I have a asp.net project. The solution has a web project and a console application. The web project also host a wcf service. And the console application consume the wcf service. They works fine before. Last month I did some change to the web project, and deployed it. My question is do I have to rebuild the console application and publish it too?

Unless you modified the method signatures (or modify classes that they may return) of your WCF Services that your console application consumes, then you shouldn't need to rebuild it.

Related

Unable to consume web service

I published a simple Hello World web service in an ASP.Net web service project.I closed this project and opened another console based project to consume this web service. The problem is I cannot discover this web service to add reference.When I paste the url, I get the following error
There was an error downloading 'http://localhost:65436/Service1.asmx/_vti_bin/ListData.svc/$metadata'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:65436
I am using Visual Studio Ultimate 2013, I don't have IIS server installed.
UPDATE- : I created a new Console based project in the existing solution and it works fine.But the problem is how do I run this console project,when I click the debug button, it deploys it on browser.I simply printed the string output returned by web method,I need to see this output on console.
I closed this project and opened another console based project to consume this web service. The problem is I cannot discover this web service to add reference.
Because the web service is not running. Web service references can only be generated when the metadata is available.
You can either:
Run two instances of Visual Studio, one for the web service and one for the client
Put a service and client project in one solution.
Also, you shouldn't use ASMX for new development. Take a look at WCF and WebAPI.
Sometimes it happens to me too. I press F5 to start debugging the web service, immediately stop debugging, and then try to update the web reference again. Usually it helps.
you can deploy the web service on IIS then consume it in console application.

Testing Silverlight Application in other PC without configuring IIS

Newbie here. I have created a Silverlight App which retrieves data via WCF RIA Services. Now I would like test it to another PC so I did a Publish. The folder contains bin, ClientBin (with xap), .html, .config, etc.
I then copied the folder to the other PCe and opened the *.html file
My silverlight app didn't run. Do I really need to configure the IIS for the other machine and deploy the binaries there to see my silverlight application in action?
Thanks!
If you want simply to watch Silverlight UI (without using WCF) you can, of cource, open *.html page with the application. But if your application needs in WCF service, the service should be runned.
If your machines in domain group and you have IIS installed for one of them, you can in Visual Studio in project properties configure use local IIS insted of developers web-server, then you should update service references and then you can browse silverlight app. from within any computer in domain network.

How to share app.config between parent console application and ASP.NET web application

Scenario
I have a web application project and a console project.
The console project is used to send reports in batch and has settings in
app.config pertaining to email.
Sometimes methods in the console project are call from the web application.
After deploying the website, I make sure that I copy consoleProject.exe.config and place it in the same bin folder as consoleProject.exe.
Problem
After deployment, If I make changes to consoleProject.exe.config, the changes are not recognized when calling methods in consoleProject.exe from the web application.
Is this default app.config file only referred to when the actual app is being executed?
Yes, if you're calling code in the console app from the web app, it is treated the same as if you were calling a dll, and your web.config is used.
Similarly, if you call from the console application into code within a web app dll, the app.exe.config file will be used.

Configuring Webservice.dll into IIS

I'm creating web service by through
File->New Project->web->ASP.Net Web Service Application.
Instead of File->New Website->ASP.Net Web Service Application.
After Coding and building Project, I got the web service Link library,
Here my question is how to deploy Link library into the IIS.
First of all, you shouldn't be doing any new development using ASMX web services, unless you have no choice. You should be using WCF instead.
Second, depending on which version of Visual Studio you are using (and you didn't tell us), you should be able to right-click the application and choose Publish.

Calls to the web service will fail unless the Silverlight project is hosted in the same project

I am opening some older demo code and received the following message when I started a debugging session:
"The Silverlight project you are about to debug uses web services. Calls to the
web service will fail unless the silverlight project is hosted in and launched
from the same web project that contains the web services."
I am working in Visual Studio 2010, and the projects are configured for .NET 4.0. There is a web project which hosts the xap file and a Silverlight project which builds the xap. The Silverlight project has a service reference to a publicly available stock quote service.
My question: What does the above warning mean (in layman's terms) and how do I resolve it?
I think this will go away if you set the web project which hosts the Silverlight application to be your startup project (right-click on the project in the Solution Explorer and select "Set as Startup Project").
Silverlight by default can only make calls either to services hosted on the same domain where the XAP was downloaded, or to services which explicitly allow callers from other domains to make this call - see http://msdn.microsoft.com/en-us/library/cc197955%28VS.95%29.aspx for more information on that. Since you say you're calling a publicly available service (I'm assuming you don't own it), then either the calls will just work (if the service allows cross-domain calls), or they will fail (if it doesn't).

Categories