Can we run a website without hosting it on web server/IIS? - asp.net

I wanted to know whether I can run my website locally without hosting it on the web server/IIS?
I mean I have created a website in VS 2010 which runs when I click on run button in vs.
I have hosted the application on the localhost.
But if I try to run the application by going to the application folder and click on the very first html/homescreen, will it respond the way it does when I click on the run in vs2010.
I want to run my app locally without the IIS OR ANY webserver, so that I can give a demo like a prototype on a machine that does not contain IIS.
What if my app contains some ajax calls?Can it run without hosting on the web server?

The short answer is no. IIS is available on most flavours of windows and is quick and easy to both setup and remove. No reason not to do it compared to any possible alternative.

Related

How does the view in browser option work in Visual Studio without IIS?

It seems like the View in Browser option doesn't really require IIS and it seems to process ASP pages fine. So how does it really work without a web server?
They used to have a developer web server (Cassini) which is dead long time back so is there some kind of built in capability in visual studio? Who processes the requests by asp pages if it doesn't require IIS?
I already have IIS installed so I am not sure if is servicing the pages but seems like it will work without IIS because I don't configure anything in IIS and new ASP.NET projects work out of the box as well View in Browser option for an asp page option which just directly executes that page.
Actually this is what occurs:
Your web web.config is copied.
Then VS spools up a WHOLE running copy of IIS (it is the express version - but it is the same for the most part as the full edition of II).
Once VS spools up and starts and configures that running copy of IIS?
Then your web page and web application can run. If you look at your system try, you see this:
So in above that 2nd from the left in the tray shows that blue thing icon. I have right clicked on it to show the options you see.
So now you have a running copy of IIS on your computer. So you ARE running a full web server here. (well, ok IIS express - but the base parts and what that means is much the same as the full edition).
Around about VS version 2010, they USED to have a smaller built in web server as part of VS. The problem of course was for Microsoft to maintain 100% compatibility was VERY hard. So while for a considerable time frame and history of VS? Yes, they had a built in web server as part of VS. But they dropped it a number of versions ago in VS, and as noted now use IIS express.
So Now? Well, when you install VS, they also install a working copy of IIS. (the express version). The express version is quite much the same as the full pop edition of IIS. What is removed is "most" if not "all" of the IIS management screens and setup. (and sometimes I wish they would just install that part too!).
Your experience thus that a copy of IIS is launched. Once launched IIS does keep running during your development process (depends on your VS config and setup). But, if you go file->close solution, then you find that IIS express then also shuts down.
So, to view that web page? Yes, VS does config, and then does spool up and start internet services and that web server. So this running of IIS on your computer is what allows those web pages to work and run correctly. As noted, while this is a copy of IIS, it is for the most part the same as the full edition - just with most of the management tools removed. As noted, you SHOULD see that new icon appear in the system tray.
And as noted, I believe around VS 2010, they made that switch from the VS built in IIS to that of now using IIS express edition. As noted, this change was made to ensure a greater probability that when coding and debugging your web site in VS, that the end result will be much the same when running a full edition.
I do find that over time, the production (web hosted site) does get so many config and tweaks and changes, that I now can't include my web.config file in the publish (can't risk overwriting the server production web.config). So, over time, we added things like https security certificates and installed them, and set them up for the production web site. I don't have those same security certificates setup on my local machine. And of course there are some virtual folders and few more things that exist on the production web site as opposed to the dev copy I use. So, it somewhat my fault to let the production web.config over time to become "different" then what I run local when coding and debugging the web site. So now, when I publish - I remove the web.config file before I actually copy the new updated web application to the final production server (which of course is running the full edition of IIS).
But to make a long story short?
Yes, a whole copy of IIS web server is configured for you, and that whole copy of IIS is spooled up, launched, and once that occurs, then your web page option "view in browser" can run. But make no mistake here - IIS services is setup, is started, and is running for that web page preview to occur.

Change deploy location for solution published using web deploy

For a long time I have been performing dated deploys to our IIS servers, basically this means that each deploy gets its own dated folder within the web site folder (c:\sites\my-site\20140824-1236 for example). I then redirect the web app to the new deployment folder.
This gives us a quick role back capability if things go pear shaped.
The problem is that we are looking at moving deployment over to the new web deploy techniques, while we have been using the new techniques within QA and UAT for a while - the standard behaviour is to simply replace the files at the location defined within the IIS web site.
Before I go and start looking at remote PowerShell to re-configure IIS before executing the web deploy.. does anyone know how I can achieve this using standard web deploy.. maybe with msbuild extensions or something?
How about using the automatic backup capabilities in Web Deploy v3?
http://www.iis.net/learn/publish/using-web-deploy/web-deploy-automatic-backups

Deployment of web application in VS 2012 to my server

I have Web Application which I would like to deploy to my web server. I do not want to use Windows Azure, I have my own server. I even do not have my profile to publish to Azure. I believe it is OK to not have the profile and continue using VS2012. I would like have complied binary files and all my pages (master, aspx) together with my controls (ascx), js, css files and without code-behind files placed in my local folder. Then I plan to pack them and copy to my server through FTP. Sounds trivial. But...
When I hit right click over my Web Application project and then "Publish...", I have Publish Web window. The first step asks me if I want to publish to Windows Azure. In this case I have to provide my profile which I do not have. I do not need it. I just want to deploy to my local folder all except code-behind files. I cannot choose the next step which is "Connection". So I hit "Publish" button. And now, now I am stuck, because I have to provide my profile (see attached screenshot). Could you tell me how I can prepare my web application for deployment to my web server? Thank you.
If you are not planning on using Azure, simply ignore the statement at the top of that screen, it is only helpful if you are publishing to Azure.
To get past this step, click on the drop down and then click "New profile".
After that you will be taken through the rest of the wizard were you can setup your connection details etc.

Changing Web Service from Localhost to Server

I've got a small WCF service I've created.
I can edit it and get it working great on the localhost, but my PC is not where this application is going to be run from. It is going to run on our Server.
However, every time I try making any kind of change to the project that points it to our server, the entire project goes to crap: I can no longer view the project in a browser and my test console application can not connect to it. I try changing it back to using the local IIS web server, but then the local machine does not start up IIS whenever the project is started so it doesn't work either.
I can debug and troubleshoot for a day or so to get it working again on the local machine, but then I'm back to Square 1 where I need to deploy my application onto our Server.
This is freakin' maddening!
My project works, but I can't seem to get it from Localhost to a real Server.
All the examples I find online show how to do this using Localhost. Does no one ever deploy their projects?
Where is the Guide for getting me from Development stage to Deploy?
Some nice tutorials here
http://www.dotnetspider.com/forum/193466-Deploy-Wcf-service-IIS.aspx
http://wcftutorial.net/WCF-IIS-Hosting.aspx
also on SO Deploy WCF Service to IIS when it only has an App.config
Also a video on youtube http://www.youtube.com/watch?v=mX8quq7MoeI

How to run an ASP.NET web application without VS2010?

Say, I have an ASP.NET web application that I can run in a web browser by opening that solution in VS 2010 and then by going to Debug -> Start without debugging, or by pressing Ctrl+F5.
I was wondering if it's possible to create a link on my desktop to run the same web app but without starting VS2010 first? (Say, by just double-clicking such link.)
Yes, deploy the site to your local IIS
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website-on-IIS
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/33e0a51a-5f8a-40f2-9923-cdd604e1a812.mspx?mfr=true
Create a windows batch file to start the ASP.NET Web Development Server and point it to your application's root directory.
Here's my .bat file:
"C:\Program Files\Common Files\microsoft shared\DevServer\10.0\WebDev.WebServer40.exe" /path:"E:\NITIN" /vpath:"/MyApp" /port:2510
http://www.codeproject.com/Articles/166319/Run-ASP-NET-Web-Application-from-Command-Prompt
http://www.dotnetperls.com/development-server-bat
Here is a great article describing how to set up your ASP.NET website in IIS. Thus letting it run outside of the visual studio development environment.
You can either upload the website to a hosting server so that the site is accessible from the internet, or you can setup IIS on your development machine and deploy your site to that.
Here is an msdn article with various links on how to go about doing this.
You Want to Run Asp.net Web Site Then U Need To Install IIS 6.0 or Higher in Your Machine..
And want to more guide then Check Out This Link..
https://www.youtube.com/watch?v=aFVcX5W0VEQ

Resources