How do I create an offline version of my Website? - asp.net

Is there a way to generate offline version of the whole Website?
All my pages are in ASPX and uploaded onto the server. When I run a demo of my site, sometimes there are no Internet availability. So it would be great to actually have the site offline but not running Visual Studio in order to show the site.
Anyone has a way to do this?
Thank you.

If you just need to run the site locally on your machine, you can just configure the project in visual studio to run using IIS (Right click on project, go to web and select to use the local IIS server).
You can then access it using http://localhost/
if you don't have IIS installed, there is an IIS express version that you can use:
http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx

You can install Microsoft IIS onto your system, and copy your site files into the "wwwhttpdocs" folder in the IIS Directory.
then you can request your site in any web browser like this example:
http://localhost:48719(somePort)/YourSiteName(SiteFolderName)/default.aspx
if you are running on Windows, you can install MS IIS from the control panel as a windows component

Related

Upgrade VS2012 project to VS2013 web site and it won't let me specify IIS port

I've recently installed VS 2013 and upgraded my web sites from 2012 to 2013 and now I can't run the sites locally because I have them defined as IIS sites but Visual Studio won't allow me to not use IIS Express. So it runs the sln on a port that won't work for me.
What I've tried:
setting IE as my default browser and changing the sln file itself
The option to specify an external host or base URL is grayed out when
going to Start Options in the Property Pages.
Any suggestions?
Thanks
Robert
From this MSDN article about ASP.NET projects and VS2013:
You can use IIS with web application projects, but not with web site projects
So it sounds like you need to either convert the project to a web application or just use IIS Express.
Web Site Projects in VS cannot be converted between IIS Express and IIS as Web Application Projects are. However, you can still use IIS with websites. You need your website to be created in IIS as a site or application, then do Open Website in VS. This will give you an option to use the file system, local IIS (via metabase), or FTP. (Or, you can do New Website, choose IIS, and copy your files from the existing site.)

How do I change where Visual Studio looks for applicationhost.config?

I've looked all over this site and I cannot find the answer to this question.
Basically I'm trying to set up a new site for use with another project I'm working on. This site will run locally on my personal computer and will also be accessible via internet. So I installed IIS 7.5 Express and IIS Manager 7 to host this site. When I went into VS 2012 elevated to create a new site and map it to 'localhost', it pulled up the following error:
Invalid URI: The hostname could not be parsed.
2nd attempt was by creating the site in a new directory by itself inside inetpub, just for the project itself and leaving wwwroot alone. When I do this, I get the following errors:
Filename:
\?\C:\Users\Joel\Documents\IISExpress\config\applicationHost.config
Error: Cannot read configuration file
File system Web sties are currently configured to use IIS Express. To switch back to using the Visual Studio Development server, change the development server option under the Projects and Solutions\Web Projects category of the Tools\Options menu.
When I browse the above location, applicationHost.config does not exist, but when I go to
C:\Windows\System32\inetsrv\config
I find it just fine. IIS Express 7.5 works fine and IIS Manager can find the default site just fine and will even let me browse it using my web browser. What am I doing wrong and how can I fix this so that VS 2012 can create web sites and access the necessary files.
I run Windows 7 Professional x64 and I just finished installing IIS Express and IIS manager. I configured VS 2012 for Web Development. I ran VS as Administrator (elevated) for all of this.
Okay, I found the solution. I needed to manually set Visual Studio NOT to use IIS. Not sure what the issue is there.
But the solution is here for everyone else having this issue.
It was right there, I'm sure, when I was setting it up initially and I just missed it. After doing that, I could set up the new website to use the file system, which would bypass IIS anyway, but the setting to use IIS was conflicting with the bypass, which caused the error.
Hope this is superhelpful!

URL rewrite rule not working in Visual Studio Development Server

How can I troubleshoot url rewrite rules that are not working in my Visual Studio 2010 Development environment?
I am enhancing an existing ASP.NET application.
My issue is the URL rewrite rules written in web.config do not work in my Visual Studio 2010 development environment. It only works after deploying the project to IIS.
I need to debug the project as I am not familiar with how it is designed and developed. It is too big a project.
If rewrite won't work in the Visual Studio Development Server, is there a workaround? I really need to work on the project in debug mode. Every time it takes me to a custom error page.
You can always debug into your local IIS. There are 3 approaches:
You should be able to do this seamlessly if your project is configured to deploy to the local IIS web server - just hit F5. It should deploy then attach.
After you deploy, browse to the local site, then attach to the running site by using "Debug, Attach to Process, w3wp.exe".
Add System.Diagnostics.Debugger.Break() to the line on which you want to break your code, deploy to IIS, then run. A "start debugging" dialog should appear when the line is hit.
URL Rewrite does not work on the built in web server used by Visual Studio. The good news is that you can absolutely debug the site easily using a local install of IIS. See the following blog entry for details on how to do this:
http://weblogs.asp.net/scottgu/archive/2010/06/28/introducing-iis-express.aspx
I would strongly suggest going the route of IIS Express (a quick web search will get you to the download page) that Scott recommends. I tried setting VS up to use my local IIS 7 and struggled with it. When I tried the IIS Express route, I was up and running in minutes with URL Rewrite working nicely in my dev environment - no need to manually attach to anything. After installing IIS Express, I just had to go into the site properties->"Web" tab->"Servers" heading->select "Use Local IIS Web server" and check "Use IIS Express".
If you create an IIS website on your local machine then rewrite should work.
If you don't have IIS installed I think you can download it using the MS Web Platform Installer.
I'm not sure if the debugger will work in this situation, but at least you don't have to deploy to a remote machine to test your changes.

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

Deploy website from a Windows XP Desktop

On my Windows XP desktop, I have a fairly simple ASP.NET targetting .net 4 in Visual Studio 2010. I can run it on my local host by ctrl + F5, it works all fine.
I have a Windows Server 2003, that I can access via mstsc, but also via Explorer. When I go to the publish section of my build properties, i see 4 publish methods :
Web Deploy, FTP, File System, FPSE
I have already installed IIS 6 successfully on the Windows Server, and given all authorizations for everything I could so far (to get things to work in the first place, will check on that later).
How should I proceed to publish to that remote machine ? Should I target a specific folder ? Do I need to setup things in IIS 6 for that site first ? Or will it all get settled from te properties I have in Visual Studio ?
Thank you guys,
J.
Personally I've always plumped for a manual deployment; that is I create the Web Site in IIS creating an appropriate AppPool and targeting the correct .NET version to utilise. From there simply copy (xcopy if you will) the appropriate files over, e.g. DLL and all supporting pages such as ASPX, CSS and associated images. In most situations where I have direct / RDP access this is what I run with.
That said, this can be automated from Visual Studio and this can be useful for those situations where you're maintaining an awful lot of sites on a regular basis. With IIS 6 and Visual Studio, this was achieved by installing FrontPage Extensions on the server then utilising the Publish option.
For VS2010 it seems this has been streamlined using the IIS Web Deploy module and configuring the Studio to publish in this manner that looks mildly quick...
HTH
I've never used the Web Deploy feature in 2010, so I can't really tell you about its merits or drawbacks. I've read that it works much better with IIS7 than IIS6. If you have direct access to the IIS root folder on the server (typically c:\inetpub\wwwroot) through a network share I would recommend doing the file system deployment. FPSE works as well if you have to publish to the server through a remote URL, but there are some security issues with FPSE that make enabling it on your web server a less than ideal choice.
Once the files have been deployed, all that should be left is to configure the website as an application inside of IIS.
Remote in to the web server and open IIS
Right-click Default Web Site and choose properties (if you've deployed to a subfolder in the root, then locate that folder and choose those properties instead
Switch to the Home Directory tab (Just 'Directory' for a subfolder)
Look for the Application Settings section and click the button that says Create
Optional: Select an app pool if you have created a custom one from the default
That should enable IIS to execute your .aspx files inside of your application. Once you've successfully configured the app for the first time, you can just keep publishing your app to the same location over and over without having to reconfigure it.

Resources