question

FirstLast-0633 avatar image
0 Votes"
FirstLast-0633 asked Bruce-SqlWork edited

ASP.NET Web Deployment using Visual Studio: Deploying to Test

I want to test publishing my ASP.Net web app from my development environment (it uses the default IIS Express that comes with VS 2017) to a QA environment that has IIS (like a Hoster will have). My goal is 2-fold - to test deploying my web app to IIS as well as QA test the web app in IIS. The web app will eventually be deployed to a 3rd party vendor(Hoster). I do not want to use AZURE.

I’m trying to do this tutorial.
https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/deploying-to-iis

It states: "an app could run and test correctly in Visual Studio but fail when it's deployed to IIS".

So, I want to test deploying the web app to IIS as well as QA test the web app in IIS.

However, the example that is out there is obsolete now. It no longer allows for the download of the Contoso University starter project. So I cannot do the tutorial to deploy to IIS.

I can't find something similar.

Any suggestions?

dotnet-aspnet-generaldotnet-aspnet-mvc
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YijingSun-MSFT avatar image
0 Votes"
YijingSun-MSFT answered

Hi @FirstLast-0633 ,
The Contoso University starter project is a project for testing. So I suggest you could create a new simple project by yourself.The content of the project could only includes of "Hello World".It's ok.

Best regards,
Yijing Sun


If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our  documentation  to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SimpleSamples avatar image
0 Votes"
SimpleSamples answered FirstLast-0633 edited

Do you want to deploy to test or do you want to test publishing? Those are different.

If you want to create a web app then test it then you do not need to deploy it. You can use the server provided by Visual Studio to test it. Or in IIS you can make the app a website and test using IIS. Then that web app can be deployed wherever it needs to be deployed to.

Do you want to try deploying a website just to understand how it works or something like that? As you indicate, you can use Azure for that. If you do not want to pay for Azure then there are a few other possibilities, but I am not aware of any host that offers free hosting. You can get a free trial for Azure.

I created Simple Samples Network when GearHost was allowing free websites but they have discontinued the free option. They will someday remove that website.

Do you want to try using web deploy locally just to learn about it without paying for a host? I assume that is possible and if that is what you are trying to do then you need to clarify it.

Web Deploy is older technology. Many organizations and developers are using Git and they use hosts that can deploy from GitHub without using Web Deploy.


· 14
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

My goal is to eventually deploy (publish) an ASP.NET web application to a third-party hosting provider using Visual Studio 2017. This web site will be a publicly accessed blog that also collects user information and requires signing in. It uses SQl Server to store the user's information for subsequent retrieval.

Currently I run and test it in Visual Studio 2017 using IIS Express as the development web server.

From what I read, an app could run and test correctly in Visual Studio but fail when it's deployed to IIS.

So, I want to test deploying the web app to IIS as well as QA test it there.

I believe I should deploy the application to IIS on the development computer which then will be the same process that I will use later to deploy it to a production environment (third party hosting).

The tutorial - ASP.NET Web Deployment using Visual Studio: Deploying to Test - was to instruct and show me how it is done.

I was trying to follow the steps but it no longer allows me to download the Contoso University project.



I'm new to GIT - is there a tutorial for Developers that explains the host and the deploy from GitHub without using Web Deploy?
- How is IIS used or is it?

0 Votes 0 ·
AgaveJoe avatar image AgaveJoe FirstLast-0633 ·

Just deploy the project to a folder on your machine like C:\inetpub\wwwroot\NameOfYourAppFolder. Assuming you have IIS installed on your dev machine, open IIS Manager. Find the application folder in the "Default Web Site" node, right click the folder, and select "Convert to Application".

You should be able to run the project on local IIS. Then it is just a matter of coping the application folder to your host.

0 Votes 0 ·

As best as I can see, most developers do not use C:\inetpub\wwwroot for development purposes.

0 Votes 0 ·
Show more comments

AgaveJoe - I have not installed IIS yet. I see that the instructions to do so were in that tutorial I was attempting to do. I just have never done it before and am cautious about it as I did not want to mess anything up on my PC but I stopped as I could not download the Contoso University starter project.

https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/deploying-to-iis

So at a glance - if you are familiar with doing an ISS install, if it is not a bother, can you tell if the instructions in the tutorial to do the IIS install are valid still? If so, I guess I can then proceed with them and then do the remainder as you suggest.

0 Votes 0 ·
Show more comments

There are very many tutorials about Git and GitHub. I think that Git is difficult to learn and I am still a beginner but it is what most developers are using now. Git and GitHub are used by both Windows and Linux developers. Git (the software) was developed by the same guy that initially developed Linux. One possible tutorial is Add ASP.NET Core projects to GitHub using Visual Studio 2019 | BinaryIntellect Knowledge Base

The procedure for deploying to a host from GitHub depends on the host. So it is best to know what host the site will eventually be deployed to. Also, you have not said whether you are using ASP.Net Framework or ASP.Net Core. You certainly can deploy from GitHub to a host that is not the same as the host(s) that the application will eventually be deployed to and that will at least allow you to become familiar with the procedure. Supporting multiple versions is exactly what Git is designed to do.

You have not said why you do not want to use Azure. I will tell you why I do not. Mainly it is because more than once I have been unable to determine what I am being charged for. I certainly understand that problem.


0 Votes 0 ·

SimpleSamples - on my PC I am using Visual Studio 2017. I have created an ASP.NET MVC application project - selected the ASP.NET Web Application (.NET framework). It is full coded BLOG web application and I run it and test it in Visual Studio. Now I want to publish it to IIS and test it.

No real reason for not using Azure. I just thought I would go with GoDaddy.com or some other. This is new to me and trying to determine the best approach.

The

https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/deploying-to-iis

was to instruct me how to do Web Deployment using Visual Studio so I can test it on IIS. Part of that instruction is to install IIS. I wanted to do the full the tutorial as I just felt more comfortable first doing this tutorial 'Deploying to Test' process before attempting to do this with my application. I did not want to mess up anything installing IIS as I have never done that. But got hung up on the fact that I can no longer download the Contoso University starter project.

So, I suppose I can just do the part of the instruction that is to install IIS.

0 Votes 0 ·
Show more comments

Well, you can create a sample web project, crete a page, and a button that shoves Hello World into a text box. I thus see no reason for a smaple web site.

However, there ARE some large considerations here. I mean, first up, I would as noted create a new web application project. Try a few things. Visual Studio lets you develop + test your site automatic (it provides a copy of the web server IIS express for you).

About the ONLY considering you need here? Do you create a asp.net web application site, or do you create a asp.net web site?

The two above SOUND the same, but they are VERY different. A asp.net web site application tends to mean that you have your OWN FULL server.

But, often low cost budget hosting will not support that option. So, you would create a asp.net web site. They tend to function the same, but publishing is easier the web site vs the web site application.

I would thus create a simple test project - run it play with it. If you have hosting now then you could test publish to that web site (say by using FTP).

So did you try create a test site in VS and play with it? And git has zero to do with this process - so don't worry about that for now.




0 Votes 0 ·

AlbertKallal-4360

So when you state "But, often low cost budget hosting will not support that option. So, you would create a asp.net web site." Do you mean create an asp.net web application?

That is what I have done. On my PC I am using Visual Studio 2017. I have created an ASP.NET MVC application project - selected the ASP.NET Web Application (.NET framework). It is full coded BLOG web application and I run it and test it in Visual Studio. Now I want to publish it to IIS and test it.

0 Votes 0 ·
Show more comments
SimpleSamples avatar image
0 Votes"
SimpleSamples answered Bruce-SqlWork edited

This is another discussion that starts simple then frustratingly goes in many directions. I give up.

· 11
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The tutorial (link posted above) states; "an app could run and test correctly in Visual Studio but fail when it's deployed to IIS".

So, I just want to deploy my ASP.NET web application to IIS on my development computer and then to QA test it on IIS (currently I am using the default IIS Express that comes with VS 2017) so that I can use the same process later to deploy it to a production environment - a 3rd party vendor.

I was trying to follow that tutorial but got stopped by not being able to download the Contoso University starter project.

So looking at that tutorial, the section 'INSTALL IIS', is that still a valid approach (it was written 1/2019) that I can follow to do the install of IIS on my development computer? I've never done that before and I don't want to mess up my dev environment that I have been using for coding and testing.

I would then want to follow the section 'Publish to IIS' (deploys to IIS using Visual Studio and Web Deploy).


0 Votes 0 ·

Well, the install IIS part is still valid, but it in general assumes that you have a server based edition of windows, and that server is setup and running. It also not clear what copy and where you obtained IIS. but I fail to see why doing a simple test publish requires some particular web sample - why not publish the test site or what you playing with now then?

So, as general rule, IIS is to be installed on a server based edition of windows. I don't know what tutorial you speak of (edit - ok, just looked), but generally the setup menus on the server edition of windows are quite helpful, but then again, that assumes you have a server edition of windows.

So as noted, IIS express is what you have now on your dev box with Visual Studio. And I 100% agree is a a great idea to setup the full edition of IIS (but, it quite a big system, and there is a lot of learn).

I suppose you could install IIS on your dev box. They seem to suggest that JUST selecting the web deploy will also give you the option (or force you) to install IIS - that was never my knowledge. Web deploy is to be installed on the web server - that allows seamless debugging and deployment from your dev box and VS.


If that step actually offers to install IIS, then so be it. Did IIS install for you? (I'm not all that comfortable turning my dev computer into running a full pop web server - I would use a VM for that, and a server based version of windows - since that's what a production server will be running).

0 Votes 0 ·

I was following the tutorial and figured I would use the example that they are using so I could follow along per the tutorial. And as I have never done it before, I am being cautious to not mess up my dev code (maybe that would not happen but as I said new to this).

My windows:
Edition Windows 10 Pro
Version 21H1
Installed on ‎8/‎8/‎2020
OS build 19043.1237
Experience Windows Feature Experience Pack 120.2212.3530.0

I have not tried the install of IIS per the tutorial yet as I wanted to know if it was safe to do so and not mess up my dev environment that uses IIS express.

So It sounds like - to be safe and simulate a production server - I need to buy a PC with a a server based version of windows that will act as my test machine.

0 Votes 0 ·
Show more comments