Hosting an asp.net website in my computer - asp.net

I have an app I am modifying for a client. The app is in asp.net. I have read that I can deploy the app in three ways:
xCopy Deployment
Precompiled Deployment
Web Setup Project
I would like to go with xCopy method. I have not installed visual studio but have SQL server installed.
Coming from a PHP background, is IIS just like apache where I can copy my files inside a directory in IIS and launch the app in a web browser or is there an extra step that required to be able to run the asp.net web app?

Here is a complete guide to:
Install IIS in windows
Install SQL Server Express
Publish to IIS in Visual Studio
Finally, test in the test environment
Note: There is no need to install IIS, just enable its some settings. And you have to install SQL Server and Visual Studio.
Edit:
Install IIS
Open Control Panel, Programs and Features, Turn Windows features on or off.
Make sure that ASP.NET 4.5 is selected under Internet Information Services -> World Wide Web Services -> Application Development Features.
Set ASP.Net Framework from v2.0 to v4.0: Press Windows + R and type "inetmgr" hit enter.
In the Application Pools pane under connections, click DefaultAppPool, and then in the Actions pane click Basic Settings.
In the Edit Application Pool dialog box, change .NET Framework version to .NET Framework v4.0.30319 and click OK.
Install SQL Server Express
Download it from here either x64 and x86 based.
After downloading SQL Server run the setup and click New SQL Server stand-alone installation. In the installation wizard accept the default settings.
Publish to IIS in Visual Studio
Run Visual Studio as Administrator by Right - Click on VS icon.
Right - Click on your project select Publish, in Publish Web create new Profile.
In Connection tab enter localhost -> Service URL, Default Web Site/yourProjectName -> Site/application, http://localhost/yourProjectName -> Destination URL
In Settings tab check Exclude files from the App_Data folder.
enter Remote connection string that you have use to connect with SQL Server database.
Check Update database and click Configure database updates add sql script Grant.sql that you will run in SQL Server which is like:
IF NOT EXISTS (SELECT name FROM sys.server_principals WHERE name = 'IIS APPPOOL\DefaultAppPool')
BEGIN
CREATE LOGIN [IIS APPPOOL\DefaultAppPool]
FROM WINDOWS WITH DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english]
END
GO
CREATE USER [ContosoUniversityUser]
FOR LOGIN [IIS APPPOOL\DefaultAppPool]
GO
EXEC sp_addrolemember 'db_owner', 'yourProjectName'
GO
Finally click on Publish.
Test in Environment
Check that your project files have exits in wwwroot folder at C:\inetpub\wwwroot\yourProjectName. Run your project index.aspx file and test it.

Related

Asp.Net Application was not working when we deployed in IIS 8.0

In Windows Server 2012 created simple Asp.Net using Visual studio 2012. Then I have deployed it in IIS 8.0. In IIS manger browse the deployed simple Asp.Net application, it was working fine when the sample Visual studio project is open. After closing the Visual studio project then we browse it from IIS manager option, the application was not working.
Please provide the solution if you know about it.
Note: The page can't be displayed error be occur.
Few Things you need to check for hosting in IIS.
Application Pool frameWork : Ensure the correct framwork is installed V(4.0.30319).
Navigate to C:\Windows\Microsoft.NET\Framework\v4.0.30319 directory
Open command window here (CTRL + SHIFT + rightClick)
Type in the Command prompt aspnet_regiis -i to register the latest framework.
Physical path Security/permission :
IIS -> (select your VD) -> Manage Application-> Advanced settings -> Physical path credential -> Choose connect as Specific user -> provide the systems username and password.
Add read/write permission for IIS_IUSERS object

Configuring ASP.NET to run under IIS in Windows 7

How do I configure an ASP.NET application to run under IIS in windows 7? I am using Visual Studio 2010 and when I run my web app I am getting an error message that you do not have permission to access the web server.
you have a couple of options.
1) copy the files to your inetpub\wwwroot folder then open iis manager and create an application in the Default Web Site of the folder you just created.
2) in Visual Studio, you can publish
3) in Visual Studio, you could open the properties page of the web application, click on the web tab and in there, an option for creating the virtual directory exists. Press it - it creates the virtual directory and you can then run the website using that url. VS will automatically launch the site pointing to IIS when you run the app
remember, be sure you are running in Administrator mode (if using UAC).
one more thing - be sure you have installed IIS (Programs and features > Internet Information Services)

how to load webapplication on server

I have made a web application using Visual studio 2008. till now it was running on my local host..
Now i want to load it onto the server so that it can run on my company server.
How do i do that..??
Thanks
In visual studio:
Under the Build menu, select Publish
In the publish dialog, select a location to publish your application to
ex: \\server\c$\inetpub\wwwroot
Set your publish options. I reccomend using the "Only files needed to run this application" setting
Click the Publish button
You will have to mark your deployment directory as an application in IIS for IIS to run your code. See this MSDN article for details on how to do this.
You just need to copy it into the IIS directory on that server, usually c:\inetpub\wwwroot. Make sure you have asp.net installed.
You can use the project menu and copy it to a remote server (specifically the machine that will host this project, in addition a web server). Or you can just go to the remote machine, add a new site and store the .aspx pages and all related images on the web servers inetpub\wwwroot folder.

Setup IIS in localhost as web development server

How can I setup IIS 5.1 in Visual Studio 2008 as my web development server? I'm using Win XP, and I was using Cassini, but I want to give a tray to IIS instead of.
Go into Control Panel -> add remove programs -> enable / disable windows features, find IIS and install it.
Go to Start -> Accessories -> Administrative tools -> IIS Manager
Right click websites, add a new website, point the home directory to the root of your site.
Open up localhost
????
Profit!
You might have to attach Visual Studio to the ASP.NET worker process to debug.
It's in the web project's property pages, under Web->Servers->"Use local IIS web server"
To attach Visual Studio to the ASP.NET worker proccess to debug go to menu Tools\Attach to Proccess or press CTRL + ALT + P and select aspnet_wp.exe or w3wp.exe.
More information here.
To develop Website using Visual developer 2008 with IIS instead of "ASP.NET Development Server", In the new website window under "Location" click on "Browse" to see the different Server options including IIS Server. User can select the server as IIS server instead of "File System", then the "Location" option will be "HTTP" instead of "File System".
In Visual developer 2008 under Properties->Start Option->Server->"Use local IIS server" option is not shown, Even though IIS server was installed and configured successfully. the only options shown are "use default server" and " Use custom server with base URL".
So in Visual developer 2008 to run on IIS server(If IIS server is installed), Need do the following:
New Website -> Under Locations Click on "Browse" -> Click on "Local IIS" and then select the "IIS Virtual Directory"(IIS vitual Directory which is directory created by the user while configuring IIS server) -> Open
While Running/debugging, the server which you selected while creating the website, the same server will used to open the website, that is while creating the website if you selected "IIS Server" then the website will be opened though IIS server.
One more thing is, while installing Visual developer 2008 and IIS server, If you installed IIS server after installing Visual studio then you need to do the following before creating new website:
Run ->cmd press enter (then enter the following Command)-> C:\WINDOWS\Microsoft.NET\Framework\Version# aspnet_regiis -i press Enter then you get message after 3 seconds "ASP.net was installed successfully".
(*Version# will be v2.0.50727 in most cases)
Before everthing make sure you have installed and configured IIS server. To know how to install and configure IIS server check the following Link:
http://chalaki.com/install-iis6-windows-xp-professional-sp3-setup-run-csharp-cgi/425/
Hope this helps.

How do I get Visual Web Developer to use IIS, and not ASP.NET development server?

I want to make sure my local is matching the production environment closely and that means running IIS and not the ASP.NET development server that comes with Visual Web Developer express edition. What is the best way to do this?
In Visual Studio you right-click the project, select Properties then Web and change it to use Local IIS. It seems the process is similar for VWD, but there there is a Properties node you open instead. I don't have VWD installed right now so can't check to see if this method is indeed accurate but the article is recent so I assume that it is.
First make sure you have installed and configured IIS server. To check whether IIS server is installed: Run->inetmgr press enter.
To know how to install and configure IIS server check the following Link:
http://chalaki.com/install-iis6-windows-xp-professional-sp3-setup-run-csharp-cgi/425/
To develop Website using Visual developer 2008 with IIS instead of "ASP.NET Development Server", In the new website window under "Location" click on "Browse" to see the different Server options including IIS Server. User can select the server as IIS server instead of "File System", then the "Location" option will be "HTTP" instead of "File System".
In Visual developer 2008 under Properties->Start Option->Server->"Use local IIS server" option is not shown, Even though IIS server was installed and configured successfully. the only options shown are "use default server" and " Use custom server with base URL".
So in Visual developer 2008 to run on IIS server(If IIS server is installed), Need do the following:
New Website -> Under Locations Click on "Browse" -> Click on "Local IIS" and then select the "IIS Virtual Directory"(IIS vitual Directory which is directory created by the user while configuring IIS server) -> Open
While Running/debugging, the server which you selected while creating the website, the same server will used to open the website, that is while creating the website if you selected "IIS Server" then the website will be opened though IIS server.
One more thing is, while installing Visual developer 2008 and IIS server, If you installed IIS server after installing Visual studio then you need to do the following before creating new website:
Run ->cmd press enter (then enter the following Command)-> C:\WINDOWS\Microsoft.NET\Framework\Version aspnet_regiis -i press Enter then you get message after 3 seconds "ASP.net was installed successfully".
(*Version will be v2.0.50727 in most cases)

Resources