Upload ASP.net website to a hosting environment - asp.net

I finish creating my website using Visual Studio 2010.. also I already have a domain name... My question is how do I publish/upload my website to my domain through the FTP server... I'm a total newbie at this and web tutorials are so complicated It makes my brain bleed...
I already tried using copy website but my website fails to appear on my domain... instead only my scripts/ ".aspx files" and resources appear on the page... in hyperlink format...
I also tried to publish the website but the same happened...

You are going to have 2 choices most likely. One is going to be some sort of ftp (or secure ftp). The other would be web deploy if the host offers it. What you want to do is publish your project to your local file system and then copy THAT output to the ftp (www) root (most likely). If you have web deploy you can also set that up in the publish settings in visual studio. Your web host should be able to provide the info you need in that case.

you need to publish your project to iis. make sure your iis is activated first in your machine, and initialize your asp framework with the iis. after all the setup are complete, then you can publish your project.

Related

Steps to deploy .NetCore 2.1 application to web server. missing steps

I have built a web app in VS2019 that is a .netcore 2.1 application. It builds and runs fine locally in debug and release mode.
I have bought space from a hosting site on there server and have a registered a domain, they stated that they can run .netcore apps.
I have deployed the web app to the servers file server, I have used Visual studios publish functionality and used filezilla, my site is in its httpdocs folder which is where there sample html index file was before I deleted them, now in this It has the webroot folder and the dll's here.
When I look up the website online it shows a 500 error.
I have never set up this type of thing before, am I missing steps, Is there something that I have missed.
Just to note, I have looked up other similar questions regarding this but havent helped.
Assuming you are trying to host this inside IIS, you need the followings to be installed on the server. You can download the same from here.. Please make sure you choose the correct hosting bundle for your application.
Once that is installed, make sure to open IIS and create an apppool. Make sure you select No Managed code.
Then you can add the web site, and assign the above apppool to the website.
Hope this helps. Happy coding <3

How to host asp.net webapi project with the current build on IIS

I want to host my ASP.Net Web api project on IIS for local development. I have an angular UI that wants to access this API. So for this reason I don't want to run my ASP.Net project all the time, if it were running on IIS would be better. I read many articles but none of them seemed to resolve my problem.
I know how to publish my project and then host the published version of the current build but what I don't want to do is having to do a publish every time I build just to test my code.
If I am not mistaken there is an option for deploying a new version of my project with every build. Again I don't want it to be production ready, I only need it for local development to test my API.
When I was using the publish > host currently published version on IIS the application was running.
When I was configuring IIS to point to the application folder where the solution is found as well (that is what I saw in an article about configuring IIS) I got: "HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
The solution is:
Go to IIS Manager in windows
On the left hand side of the panel, right-click -> add new website
Add a Site name that you like
Set up a Physical path, that should point to your project folder (so not where your solution is but where your ASP.Net project is)
Add a unique port that number that you make sure you are not currently using
Add a host name, and register it in the C:\Windows\System32\drivers\etc\hosts file with your local ip address

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.

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.

Newbie Trying To Deploy Asp.Net Website

I'm basically wondering what the best way to deploy an Asp.Net Web Site is, mostly from the point of view of security. Right now, I'm trying to publish the website using Visual Studio 2010. Could someone direct me to a good tutorial on how to do this securely? For example, can it be done over an encrypted connection via Visual Studio? Is it necessary to install any software on the server to do this? Should I use a different program to open up an SSL (TLS) connection first, and if so, which program (does it come standard with windows)?
The server is running Windows Server 2008. Development is on Vista.
Many thanks in advance for any direction in this matter!
Andrew
I would publish the site to your local machine and file copy the files across to your test/production environment. As a rule we don't publish sites straight from VS to test or production.
For example you don't want to accidentally push things straight from dev into a live environment do you?
As far as the file transfer security goes you could use SFTP.
Note: First thing is to check with the owner of the server, as they often will provide you an FTP connection and will take care of configuring IIS.
If you want to add security, make a keyfile and sign your assemblies and consider running Dotfuscator on your dlls, the community edition is included in Visual Studio. Here is an earlier question where I've put more info on Dotfuscator.
If you have to do the deployment yourself, here's a few things to consider.
XCopy (easy)
MSI (have to create a setup program, you can do this easily in Visual Studio)
There is no security advantage in deploying using Visual Studio, but you can use Visual Studio to create a small setup program. One thing you want to make sure for security is DO NOT deploy any .cs files. Prepare your files, you should compile in Release mode, make sure debug is not enabled in your config file, keep your bin and it's dll, also the aspx, asmx, ascx, svc, css, js, and config files.
XCopy: Install a small FTP server, or use one your company alreayd has, this will allow you to get your files once you are logged into the target machine. You should be able to get an administrator account for the target machine, just ask the sysadmin of the domain, then log on using remote desktop, got to your ftp site, and download your files. Open IIS on the target machine, create a virtual directory and a pool. Copy your files to the location, configure your connection string to your DB if you use one, then test your website.
MSI: same process as above, except the setup will create the virtual directory and pool for you.
Here is extra info on best practices from the official ASP.Net website.
If you have some control on the server (e.g. to configure IIS7), you might want to look into Microsoft Web Deploy (new product just been released):
http://weblogs.asp.net/scottgu/archive/2010/09/13/automating-deployment-with-microsoft-web-deploy.aspx
Haven't tried it myself, but looks quite slick and it apparently encrypts the data being copied up, so might suit you.

Resources