Deployment of web application in VS 2012 to my server - asp.net

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.

Related

How to start asp.net application without .sln file

I have a working codebase of a web application written as ASP.net webform application, Visual Studio community edition. How do I start the application. Meaning how do I start the application / debug,
Community edition IDE expects something like a .sln file which I don't have, or its not present in the codebase.
I have been writing code for more than a decade, but I am new to ASP.net, require some help.
Normally (as you note), you find(have) a .sln file.
However, if you don't, then usually you have (will find) a .vbproj file for vb,
or a csproj file for c#.
When you open these "project files", then VS will create .sln file for you.
However, the 3rd possibility is this is not a asp web site application, but a asp.net web site (note HOW VERY close the term is I used:
Asp Web site = (no sln, and no project file)
Asp Web Site Application = (should have a .sln, but you have one if you open proj file).
So, if no .sln file, and no .vbproj/csproj file is found?
Then you have what is called a asp.net web site.
They are VERY close in terms of editing, writing code etc. However, a web site is NOT opened as a project (.sln/.proj) file, but you simple use this option:
In this case, then when you select above option, then you JUST browse to a folder, and you don't have a .sln/.proj file at all. You are in effect just opening a folder that has the web site inside.
I don't have a great/nice link that explains the difference between a asp.net web site vs a asp.net web application.
However, the major difference is:
The Asp.net web application
near ALWAYS expects that you have a dedicated server to publish to (so lower cost hosting will not work).
You have both control over the whole web site features - can write custom page handlers. You have more options for authentication. In effect, you can code and change "base" features of internet services. So, you have direct use of the web server features - and can over-ride behaviors.
Asp.net web site
This really is just a sub folder. So, for example, this option can be used to up-load your web site folder to a existing server. And you can modify one page (and code behind), and you really don't have to re-publish. This option of course OFTEN has to be used if you using some low cost web hosting. You can't publish a web app, since it would quite much over write the server features - including the base starting page.
With a web site app? The whole site is re-compiled, and the whole application is compiled down to ONE .dll. (much like a desktop application, of course additional .dll's and libraries can appear as separate .dll's). but, they are usually all merged into one .dll.
So, the existing of .sln, or .csproj/vbprjo files will quite much tell you which type of web site you have.
While a web site app requires a full re-publish of the whole site - even for one small code change - I still prefer that setup WHEN that option is avaible. This is due to having additional options, and control over session() events, and more.
However, as noted, in a lot of hosting environments, you only get a folder and some place to shove up your folders and web pages - and thus full web app publishing will not be a option for you.
#albert-d Fantastic answer!! it led to a lot of development,some how i figured out something.
cd theapp
dotnet new web # Create basic web soln/app
dotnet run
This sort of created default web app on the folder
info: Microsoft.Hosting.Lifetime[0]
Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: /Users/raj/theapp/
On the browser it give nice output
But when I try to execute my old files present, like
http://localhost:5000/Default.aspx
Its not working.
Giving following error
Looks like I am losing a battle for want of nail. Could you pls clarify.

How to run asp.net webpage on the localhost

I am just learning asp.net and have created a simple webform on visual studio. How I can run this on the localhost(xampp). Like HTML you simply put files to the server folder and it works. But when I copy all asp files it simply shows me source code?
It is stupid question but I really need answer...
ASP (ActiveX Server Pages) is a deprecated technology (superseded by ASP.NET). Thus support is not included as standard in IIS. But it can be added by using Server Manager under Roles | Web Server (IIS) and scrolling down to Role Services.
If you however mean ASP.NET then, initially, look at the Web tab of the project properties and start in VS for debug and test. Once that is working you'll need to read up on deploying ASP.NET on MSDN.
To host a ASP.Net page you usually use IIS. You are supposed to run IIS on your server and host the ASP.NET website on the IIS Management
This Article on MSDN should help you with that.
Also, you usually use visual studio to 'Publish' to the server folder, rather then copy and paste the files. In case you didn't do this: this is done by right-clicking the project in visual studio and selecting 'Publish'. Then there are a few options, you can publish to a folder (File System) and then move the published project to your server, or publish it straight to your server.

Is it possible to use the Web Application project and make changes without having to recompile/redeploy the whole project?

I read this post, but I do not think it really answered my question. I realize that the Web Site project is best(?) to use if you want to be able to make changes to the web site and deploy, say, User Controls/pages, without having to recompile and deploy the whole site.
However, is this possible to do with the Web Application project as well? What about Web Application and Web Deployment project options? I basically have a high traffic web site and I want to make changes without having to force redeployment of the whole site.
Thanks
Basically whilst deploying Web Application using Visual Studio it redeploying only the changed files, so do not worry about that.
ASP.NET Web Application Project Deployment Overview
If you use one-click publish to deploy your application to a
third-party hosting company, the hosting company will typically
provide you with the settings that you require for the Publish Profile
dialog box.
When you have finished specifying publish settings, you can click the
Publish button in this dialog box or in the Web One Click Publish
toolbar. Visual Studio then deploys the application on the destination
computer. When you click the Publish button after a Web application
project has already been deployed, Visual Studio redeploys only the
changed items.

How to deploy an ASP.NET web site

I have an ASP.Net website that I built in a computer science class. I built it in Visual Studio and the solution is on my local drive. How would I deploy this to a real website?
You will need to do a few things.
You will need to get a hosting account that supports ASP.NET
From there you can use the "Publish" option from within Visual Studio under the "Build" menu option to push out a copy of the site.
When publishing you should publish in release mode.
Get hosting that supports the version of .NET and ASP.NET you have used and copy the files over.
Assuming that already you have an IIS application and web folder set up on a web server somewhere, the simplest method goes like this:
In Visual Studio, right-click on the web application project, and click Publish.
Select File System as the publish method.
Select a target location. This is where the publishable files will be placed. Use c:\pub or something similar.
Hit Publish
Once the publish operation is done, copy everything in c:\pub (or whatever target folder you used in step 3) to your web folder on the web server. Depending on your server accessibility, you may need to do this via FTP.
You might also investigate ClickOnce Deployment if your server supports it.
If you don't already have server space, you'll need to find a good hosting provider that supports ASP.NET. Google has many suggestions.

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.

Resources