How do I properly deploy a website from Visual Studio and make this ASP based site function properly? - asp.net

I'm sure there's something simple I'm missing.
I'm attempting to help a buddy move his ASP site from one host to another to avoid some questionable billing practices. I usually work with PHP-based sites (Wordpress etc.) and, unfortunately, have no experience with VS or ASP.
He's temporarily moving to Godaddy on their Plesk offering temporarily until he can work out something else. He provided me with all of the files contained within his ftp (containing his site's default.asp file, header, footer etc.) as well as an archive.xml, parameters.xml, and a systemsinfo.xml file. No .snl file or anything like that.
The files did not come with a web.config file. The error I keep getting, after uploading the FTP files is "HTTP Error 502.5 - Process Failure". From my understanding, it's often related to the web.config file. And from what I understand, you can have one generated by deploying the site through VS. Problem is, I'm at a loss as to what the proper actions to deploy this project.
Plesk provides a .publish settings file, I'm just at a loss as to how to properly open this file in VS to then have it create a "web.config" file and proceed to have it publish to the hosting. Part of this is I'm unsure how to properly open a project like this in Visual Composer to then proceed with the process of setting a web.config file and going forward with the deploying.
Not knowing exactly how to open this project without an .snl file or anything, I tried creating a new project and dropping in the other files to try and set up the process that way with no luck. Considering that Plesk provides a deploy file with that information, I'm assuming if I can properly open the project, working locally, I can then go through the deploy process. I'm just at a loss as to how I can properly setup a new project with someone else project files without an .snl file or otherwise.
Any guidance that you provide would be awesome.
Thank you.

Well, if you missing basic files required to operate the site such as web.config, then you don't have the site or files required, right?
Either FTP down the existing site, or you go to the source code and VS project, and re-compile the code, and re-publish. In fact, I suggest publishing to a local simple file folder.
Even publishing to a local file folder is a good start. Now, just copy that local folder that you published from the source code project, and that published folder should work on the new site. But, really, missing files like web.config? Rather fundamental that you have ALL files of that existing published site, or you have to go back to source code project in VS and re-publish.
since that site has vb.net or c# code? Then it also not clear if the original site was a
asp.net web site
or
asp.net web site application.
Rather critical you determine the above. The reason is that for a asp.net web site application, then at publish time, all code is complied at publish time, source code is stripped out, and then you have a working site.
If this is a web site (not web site application), then all source code is in fact published to the web site, and IIS is now responsible for compiling the .net code.
but, gooly, without a web config file, you simple don't have the files for that site to work - NOT even close!!!
but, as noted, if you have the original source code and VS project, then I would of course use the source code project for the publish. As noted, you can publish via FTP, and several other ways - but I in most cases use folder/file publish to a local folder, and then that is FTP up to the site.
You also don't mention if a database is involved. But, the connection strings to the database will FOR SURE change on the new site - and that boatload of required information will of course be in the web config file.
So, what road will much depend on if you going to download the exiting site, or your going back to the original source code and Visual Studio project.
So, first step - which will take about 10 seconds of your time is to determine if this is a asp.net web site, or a asp.net web site application.
If the existing published site has the c# (or vb.net) source code, then this was/is a web site.
If the existing published site does NOT have the source code, then of course this was a asp.net web site application - and Visual Studio is responsible for compiling the code BEFORE publish.
I guess this really comes down to if you have the source code and the original project used to build the site in VS or not?
I mean, if you have the source code (not compiled) of that site and have the full project in VS, then that's your best starting point. And if that site was published asp.net web site (application), then FTP and downloading the site WILL NOT get you a working asp.net project in VS.
This is much like saying you have a some .exe program, but don't have the source code and project used to build that .exe.
Same goes for asp.net. but, as I stated, often the web site as opposed to web site application model is used, and in that case, then you would get and have the source code files by a simple FTP download. But, you don't even have the web.config file - and that makes no sense at all, since that going to exist in the current site if you download, and it would exist in the original VS project used to create that site in the first place. During a publish, we often have an additional config file that has the local database connections, and during publish, they are transformed into the correct database connections for the published site. But then again, you not even noted or mentioned if a database is involved here.
I mean, if I was handed a LAMP project (Linux, Apache, MySQL, PHP), and had to publish that site? gooly, I not worked with LAMP, but I'm sure it would be a week, or more for me to figure that out, since I'm not familiar with LAMP, and how such sites are laid out, let alone how the configuration of such a site works. Big job if the whole system, programming language and framework is something you never used before.

I know that Godaddy use Plesk control panel too. But you need to make sure that Godaddy has support .NET Core. You may refer to this post https://dotnetblog.asphostportal.com/how-to-fix-error-502-5-process-failure-asp-net-core/. I believe it will solve your issue.

Related

Old Asp.Net Web Site Project - No Project file?

So I have an Asp.Net website that i'm responsible for. I'm having a build issue, that as far as I can tell, may be either MacAfee or some other random cause.
But thinking back, I want to say the problem started when I added a "Test.aspx" form to the site, did some testing, then removed the Test.aspx form from the site.
I'm using TFS 2010 as my source control as well. Which I don't know if it applies or not.
My question is, is there some hidden location where all files to be included in publishing a website is maintained?
Is there a Project file for a Web Site app and if so where is it?
I've built the site using MSBUILD and notice some metaprj project file in the output but I can't seem to find any such file.
Web Site apps aren't meant to be built into a dll file. There is a conversion wizard to make it a web project but it doesn't always work well. My advice would be to continue to work with it as a Web Site app. The code files are compiled at at runtime on first use. You can run from Visual Studio or setup a site in IIS. Nothing is hidden in a Web Site app and there is no project file. So, you shouldn't have a build issue because you shouldn't be building. Try to run the app as is and if you get an error let us know what the specific message is.

Deploying a Visual Studio website vs web application

So I'm using visual studio 2010 to build a website that was formerly running on PHP, so I'm pretty new to the environment.
In starting the project I built a website project, not a web application project. I know that will probably generate a lot of "never use a website project, use a web application project instead" comments, but bear with me.
I'm attempting to provide our server team with the necessary files to compile on our server for the first time. However they're used to working with web application files, not website files.
Normally they are given the source code and a batch file that compiles the code into deployment directories and then they just move the files to the server from there. I'm pretty sure that the other teams use deployment packages to do this, which obviously isn't an option for a website.
My question is, what would be the equivalent steps for getting the source for a website ready to deploy vs a web application? I have published the website to a separate folder and this has rendered what I think is the equivalent in many ways, but I wanted to make sure.
Also, is it possible to publish certain parts of a website without others?
Please with-hold all the comments about how I should be using a web application instead, google seems to assume that's all that's used out there too.
Thanks!
There isn't much to deploying a web site other than copying the source files to a directory in IIS. It will compile the site automatically on the first page request.
I agree with Britton. I personally prefer web application but with the web site project you have 2 options.
Either a) Upload all the files (including the .vb or .cs files) and the web server will compile on the fly. OR, you can publish to a separate folder locally on your machine, and then upload that folder. I would do the publish if you don't want anyone seeing your source code.

VB.NET Application - Open website vs project file acts differently

I noticed one weird thing today, and I'll appreciate your input on this.
I was assigned to work on a VB.NET project. I took the project files from the server locally.
I opened Visual Studio and then did open project, the project loaded in the solution and I did build, I got errors, pls check screenshot:
http://gyazo.com/3fe2ea4d5ff8fd073355d43160861e70.png?1348166929
2nd try, I opened Visual Studio and instead open project, I did open website, I selected the folder where the files are located and then open website. I build the solution, it says build succeded and the website runs fine in the browser.
Now I want to know why that's happening, why when I am trying to open as a project I am getting errors, and when I am opening as a website, website starts ok.
Thanks in advance, Laziale
In VS, Projects and Websites are different - a Project is a collection of files managed by a *.proj file (e.g. *.csproj, *.vcproj, *.vbproj), whereas a Website is just a filesystem folder without much in the way of project management metadata.
The second main difference is that Websites have a different Build process - unless you explicitly opt-in to pre-compilation the project is not compiled at design-time, instead everything is compiled by the webserver at runtime, which means you need to distribute all of your source code.
It also means that compile-time errors are harder to detect. You will get the same errors in a Website as in a Project, it just means you need to perform a live website action that uses the same error-prone *.vb files, and you'll get a lovely YSoD error then (rather than in the IDE before you publish it).
"Websites" were introduced in VS2005 as an "easier" alternative to VS2003's ASP.NET Web Applications, but there was a lot of backlash from developers - I wouldn't be surprised if they removed it from a future VS release.

Uploading issues with an asp.net website

I have created my first website using asp.net 3.5 .
I have used App_Code for managing my source code files.
Now, after completion:
List item
What needs to be uploaded to the server ?
Do uploading all file including webforms files, source code files make any sense ?
Please provide your own suggestions apart from these.
You should look in to one of these several very good tutorials and articles about deploying ASP.NET applications.
How to Deploy ASP.NET
15 Seconds: Deploying ASP.NET
Deploying ASP.NET Applications on IIS 6
Deploying ASP.NET Applications
Now to your thoughts on what should be uploaded and what not. If you understand the asp.net cycle and how the files are processed by the webserver, it would be easy to know that all files need to be uploaded. But since this is your first application you probably don't have that knowledge.
So, to save you some reading time, Upload everything. In older versions such as 1.1 you had to compile all your source-code into binaries, which you don't have to anymore, but you can, it's up to you.
I However prefere to upload all the files without compiling it to binaries, makes it easier to manage once they are on the server.
The webserver will upon request ( first request ) compile these and then use the compiled files on other requests, this is the short answer anyway, this is why the load-time is longer the first time and the other times it's ( suppose to ) go faster.
Also, worht to know is that if you change the web.config, the application will re-compile.
So just drag n' drop em' to your webb-location and start playing!
If you are using the App_Code folder, it sounds like you are using a web site project type. In this case, the easiest thing to do is just xCopy all of the files up to the webserver. IIS will then do Just In Time compilation (JIT) the first time a page is hit, and will compile your code on the fly.
rgds,
Paul
All content files (i.e. aspx, ascx, asmx, asax, js, css, htm, jpg, gif, png) and DLLs need to be deployed to the server. I recommend using the Visual Studio "Publish..." option on the Build menu to do this for you. It can deploy to a folder (which you can then copy to somewhere else if you like), an FTP site or to an IIS virtual directory.
Uploading your .cs or .vb files is not necessary. It will still work if you do but it's probably safer not to. There's a remote possibility that IIS will have a vulnerability or a sysadmin will make a mistake and your source code will end up being served to the public.
In Visual Studio you could could do File -> New Web Setup Project and build an MSI to do it. This article and This article have more details on this option.

Subversion and using IIS for ASP.NET development

I'm a total newbie to SVN and haven't been able to find an answer for the following situation.
I have an ASP .NET 2.0 web app that I am developing. I am using my local IIS as the development web server (i.e. not the Visual Studio web development server). My development environment is VS2005, Vista, IIS7, TortoiseSVN / AnkhSVN. VisualSVN is installed on the server.
My .sln files and class libraries, etc. are located in the **C:\Localsource\Projects\ProjectName** folder, and my .aspx files are in my **C:\inetpub\wwwroot\ProjectName** folder.
I can set up the repository for **C:\Localsource\Projects\ProjectName** fine, but can't think of a way to set it up for the IIS folder as well in the same repository.
What's the best way for dealing with this development environment in SVN?
Many thanks,
Ant
In a solution in Visual Studio you can have a class library project which is usually in a directory underneath the .sln file.
In this case he also has a web project within the solution but NOT underneath the .sln file in the file directory structure.
He will be attaching to this project via HTTP not via local file path.
IIS will manage this as http://localhost/webapp and by default will place it in c:\inetpub\wwwroot\webapp. The files in webapp folder will not be in the repo as they arent in the hierachy of the solution and the class library. This is his question how to sort it out.
My answer is to move http://localhost/webapp to point to a folder that is underneath the .sln file and adjacent to the class library directory then it can all go in the repo.
Seperating the class library and the the webapp is best practice to aide code re-use and decoupling the logic from the web site.
Can you not just point IIS to C:\Localsource\Projects\ProjectName and set the permissions?
Hmmm - Good point. It was set up like this when I got here, and Visual Studio always creates websites in the wwwroot folder, so I assumed wwwroot was just where they had to go.
Maybe I'll have to think about doing a little rearranging...
Thanks!
The IIS folder is not the output of the code base it is part of the application. It's not CGI output or anything but actually the scripts to run the app!
This is the .aspx pages that will have user controls and HTML to actually run the application. Its part of the applciation but split away from VS Studio solution.
The easiest way is to have a solution and then C:\Localsource\Projects\ProjectName\WEBSITE.
Point IIS at that folder as well.
OK, I may be being stupid here but.. Why do you need to add the IIS folder (i.e. the output of the code base) to your repository?
Update
I think I should clarify this a bit more.. What I mean to say is I am not sure why the ASPX is seperate from the project anyway? What is wrong with an Web Project and n Class Library Projects in a Solution, added to your repository.. You then publish on each new release..
If it is simply a case of "it might be easier to roll back the published output" then so be it, I was just curious as I have not seen many people actually work that way.
Deployment of solutions in this structure would be a lot easier as well..
I think you might want to separate this into two problems, following this recommendation from Dillorscroft.
First, with regard to the material on your development server that is published to the production site, I think you need version control for that. First so you can roll back any page, and you can also decide when you have a stable level of the development site that you want to extract to production. (I would get that from the source control system into a site image and then synchronize that image with the production site.)
So, for the first part, we are talking about versioning the web pages and all of the custom server-side material that supports the web site.
Secondly, With regard to the development of components that are used on the site, they need their own development projects, since it is the result that goes to the development site, not all of the source, libraries, etc. that the component is built with. So these will have their own project development tree (think of it as if you were building a library that is to be used by other development projects, although in this case the other projects are web pages). So the only thing that should show up in IIS is the "deployed" component to the development site.
There seem to be three critical questions for you:
How development of tests that need to go against the web site is handled and where that is version controlled (assuming they do not belong on the web site itself)
How easily you can arrange to make sure that all content on the development web site is kept under version control and checked-in and -out appropriately. (This has to do with the tools you use to edit web pages and other server-side gunk other than components developed off to the side.)
Easily taking developed components from the projects that produce them to the development site and have them be checked-in there.
My solution to (2) and to version control of the development web site is to use Visual Source Safe integration with IIS and FrontPage extensions that places the site under version control. Components produced from other development projects are mapped to the server project by VSS sharing.
For SVN, I speculate that (1) you want to see if there is an SVN adapter that IIS will recognize as an external source-control system and, either way, (2) have a discipline that takes delivery of components from their construction projects into the overall web site project.
Rob,
Why do you consider an .aspx file an output of the code base?
It is part of the code base. It's not an output after compilation for instance.
Just wondered?

Resources