How can I change the URL of my IIS published web application - visual-studio-2010

This is my first time publishing my visual studio project. I am using IIS manager to publish it. My server name is KIMSERVER and the port I have now is 97. Thus when I need to launch the web app I saved I need to type KIMSERVER:97/
Is there any way that I can change the URL to KIMSERVER/WebApp1 or any URL I want?
Thank you.

Create a new Virtual Directory in your Sites App Pool (Name it WebApp1 and it should be possible to connect via KIMSERVER/WebApp1).
After you published to it, its converted to an application.

Related

Building and starting a web role in Visual Studio with a specific URL

I have an Azure service containing a web role. Both configured to run on IIS Server locally. I would like to build/deploy and start the web role in a specific URL in Visual Studio. It always ends up in addresses using 127.0.0.1 even I specify what project URL is in the project configuration. Is there any way to change this something like dev.xxx.com?
You're running through the local emulator I assume. As such, the URL project settings won't apply. Just like if you deploy it to the cloud, you'll need some type of DNS forwarder or alias.

Service in Silverlight application does not work when deployed

I've created a Silverlight application that uses a service. The service is defined in the web project in that solution. The silverlight application references it and uses it.
Everything works locally on my dev machine when I run the application in Visual Studio.
I note that the url im given from VS is: http://localhost:50453/Default.htm
But when I deploy this (by filesystem copy deploy option) the web page starts and it looks okey except that it seems to have a problem using the service.
In the Silverlight application, if I look at the reference settings the url to the service is: http://localhost:50453/SilverlightService.svc and thats probably whats wrong, as the server that Im deploying to does not have a clue whats on port 50453.
So Im trying to change this port to 80 on my dev machine but Im out of luck. My web project does not have any property where I can change the port. Opened URL and URL is locked at http://localhost:50453 :-/
How can I change the my dev environment to match the production environment with port 80?
For sure you can change the web project's URL in project properties, but this is not a good solution because you'll get the same problems when accessing the SL application from a remote computer.
You need to set the service URL programmatically, like above:
ServiceReference1.Service1Client svc = new ServiceReference1.Service1Client();
Uri serviceUri = new Uri(System.Windows.Browser.HtmlPage.Document.DocumentUri, "Service1.svc");
svc.Endpoint.Address = new System.ServiceModel.EndpointAddress(serviceUri);
This solution uses the same URL that you are using to access the Silverlight Application.

"You have created a service." How did this happen?

When I create a new "WCF Service Application" in Visual Studio and right-click Service1.svc, I can choose "View in Browser". A web browser appears showing http://localhost:50311/Service1.svc, which says
Service1 Service
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
svcutil.exe http://localhost:50311/Service1.svc?wsdl
...
The service somehow seems tied to Visual Studio itself, since the web page becomes inaccessible if I close the solution. What's going on? I don't have a web server installed, and I didn't (knowingly) start the service. What is the source of the displayed web page, and why is it on port 50311? Can the page be customized?
What you're seeing is the development web server that starts when you run a debugger instance of a project that requires a web server. (WCF, ASP.NET).
The port 50311 is determined by your project settings (most likely random, but you can specify).
The page for a .svc file is not meant to be customized. Since the service is waiting for a caller, that default page simply tells you that it's running properly.
Keep in mind that WCF offers several binding options that use various protocols (HTTP, TCP). Depending on the protocol that you choose, you will have to host in either IIS, a Windows Service or elsewhere. By default, new services will adopt a binding that works in IIS.
Check out Introduction to Building Windows Communication Foundation Services

How can I get Visual Studio Web Development Server (Cassini) to send the domain name of the request to the web application?

We're developing an application that is sensitive to the domain name of the request. The problem we're running into is that we have to use IIS in order to test the application because Cassini will only send "localhost" as the requested domain despite using a different domain in the address bar. While IIS does give us better performance than Cassini, we would still like to be able to hit F5 to run our application from within Visual Studio.
Is there any configuration that can be done to specify the domain name to use in Cassini?
I just released the CassiniDev 3.5.1/4.0.1 beta with a simple test fixture example if you are interested.
It supports arbitrary IP addresses and host names. Should fit your needs quite nicely.
http://cassinidev.codeplex.com

how do I add a test web service to my project in Visual Studio?

I have a test web service replicating a live web service that hasn't been made public yet (It will be public when the app is released).
I added a new ASP.NET Web Service Application to my solution. Now when I try and add a web reference from the main project and choose "Browse To Web services in this solution" it doesn't find the test web service.
Am I missing an important step here?
Maybe the webservice you're trying to connect to isn't running . Do an F5, verify that the service has started by checking the address in the browser then try to add the refference again.
If it doesn't work, just specify the address by hand.

Resources