Visual Studio Toolbar - asp.net

In Visual Studio:
New->Project->ASP.NET Web application
New->Website->ASP.NET Website
What is the actual difference between these two, though we are opening webapplication?

Web Application Projects are projects, like any other Visual Studio project. They have a project file (.csproj or .vbproj) which is an MSBUILD description of how to build the project. This is how Web Applications were built on .NET since Day 1.
With Visual Studio 2005, Microsoft decided that this was too complicated. They got rid of Web Application Projects and replaced them with Web Site "projects". These are not actually projects, but are rather a collection of files in a folder tree, on disk, on an FTP site, on IIS, etc.
They were loudly informed of their error, and quickly came out with Visual Studio 2005 SP1, which put Web Application Projects back in the system, where they are to this day, and always will be.
The code in a Web Application Project all gets compiled into a single DLL. The code in a Web Site is only compiled when it is referenced. This can be a benefit during development - I'm working on one now, and actually find it sort of cool to be able to change some C# code, save it, then press F5 in the browser to see the affect.
On the other hand, what I'm working on now actually is a web site - it's not a web-based product that needs to be packaged up and shipped to customers. I may be old-fashioned, but I don't like the idea that my code doesn't compile before I ship it to customers. I was taught (the hard way) to test what I ship.

Related

Which IDE for VB.NET code built on .NET framework 2.5?

I used to use MS Visual Web Development (VWD) Express 2008 as IDE for a website which was developed on .NET framework 2.5 with VB.NET and runs on IIS 7 originally. About a year ago, MS stopped downloading the VWD Express 2008 and now I am in need of an IDE for my old VB.NET website. Which IDE will allow me to maintain this old VB.NET website?
Here is the detail info of VS 2019 community installed:
Here is screen shot of the existing project I am maintaining.
You can go with Visual Studio Express.
(edit: It is now called Visual Studio Community Edition).
It should work fine. To be honest, I never used Visual Web Developer.
Just keep in mind, that you want to open the project as a web site, and NOT a project. Quite sure that's how VW developer worked and was setup.
I'm not even sure they have VW developer anymore, but Visual Studio Express 2019 should be able to open + work on that web site.
So, to open a web application project, then you use this option:
(this means you have a .sln file).
So this:
However, this might ONLY be a web site project. So, you can use this option:
So, I would certinly try to open the project (folder) where the site exists, and see if you can find a .sln file.
If there is no .sln file, then you can try to open the .vbproj file.
But if you open a "web site", then you ONLY select the folder where the web site exists. (you don't open .sln, or .vbproj file - but open the FOLDER.
VS 2017 is the last one that explicitly mention supports for .NET 3.5, and the Community version is still available with the free Dev Essentials account. If you're ineligible for Community, then the Visual Studio Express 2015 for Web is the one you want.
That said, even in the latest VS 2022, I still see the option to switch a project to target .NET 3.5, and the template still offers Web Form development.

ASP.Net - Missing "aspx.designer.cs" files

We have two ASP.Net projects that we maintain with Visual Studio 2019.
The first project was originally built 10+ years ago and has been upgraded from one Visual Studio version to the next over the years. Everything runs fine.
The second project is a brand new project created with Visual Studio 2019. There are several web forms that we would like to import from the first project to the second project.
The Problem: Those web forms from the first project don't have a "aspx.designer.cs" files - each form only consists of an "aspx" and an "aspx.cs" file. And when they're in that first project everything's fine. They compile and they run fine. If we right-click and go the definition of any of the declarative objects in the "aspx.cs" file a window pops up saying it can't navigate to the symbol - which is fine. Everything works.
BUT... When those web forms are imported to the second project, all of the declarative objects show as being undefined - there's no "aspx.designer.cs" file where they'd normally be defined.
Any thoughts? How can we import and actually use these web forms in the newer project? Do we have to go and manually create that "aspx.designer.cs" file for each web form? There's quite a few of them...
Thanks!
Curt
All these effects are expected. An older/legacy site is represented by the "ASP.NET WebSite" template/structure, while the newer one - the "ASP.NET Web Application".
Check out the following threads to find differences and possible hints for migration (in short - move files as is, correct some #Page directives and code namespaces, switch to the ASPX Design View to re-generate the associated Designer file):
ASP.NET Web Site or ASP.NET Web Application?
Web Application Projects versus Web Site Projects in Visual Studio

Web Deployment tools for Visual Studio 2013

I am responsible for supporting a relatively complex Website project written with .NET 3.5.
Previously I was using Web Deployment Project with Visual Studio 2010 to deploy this website but at the moment I have only access to Visual Studio 2013.
As far as I know, there is no longer such a tool to be used for deployment in Visual Studio 2013 and I do want to compile the code before deploying to the production server. As mentioned earlier, the project is a bit complex and this would not be easy to be converted to a Web Application.
Any idea?
Unless I missed it, unsure what the issue is - in VS2013, Publish is what you are looking for (either WebSite or Application).
What exactly do you mean by "none of the (vs 2013 publish) options worked"? What is/was the issue?
In one of your comments, you state you want to "pre-compile" (aka "don't want to upload .cs source files) and that's a setting in Publish.
You can Publish to your local file system: "Custom" -> File System:
This extension still exists for Visual Studio 2013: http://www.iis.net/downloads/microsoft/web-deploy
Little bit confused with the question because you are keep referring about website rather web application.
If you are looking to convert web site to web app then you need to follow this: http://msdn.microsoft.com/en-us/library/vstudio/aa983476(v=vs.100).aspx
Otherwise, if you are referring about the deployment project. Yes, it is no longer available.
I'd a very similar situation like you and Since 2013 I have stopped using any deployment project, instead I have started using Publish that creates a deployment package for you on a Network , FTP, Local Drive or even on Azure.
Here is a nice guide from Microsoft
http://msdn.microsoft.com/en-us/library/dd465323(v=vs.110).aspx
If you still want to go for Deployment Project, then you would need to go for "Installshield" limited edition,which is free (http://samirvaidya.blogspot.com.au/2013/11/how-to-enable-installshield-le-for.html).
http://msdn.microsoft.com/en-us/library/2kt85ked(v=vs.110).aspx

ASP.NET Website No Publish Option

I took on a project that was developed by another developer. The client needs a few alterations made to the site so I got the source code and found out it was developed as an ASP.NET Website project (not web application). Looking at the FTP site, each code behind file is complied down to its dll in the bin folder.
I opened up the web site using Web Developer 2012 Express, made the alterations and even successfully debugged the application and everything looks good. The problem is I can not figure out how to publish it! When I build the web site no dlls are generated in the directory structure of the application. Further, there is not Build menu and thus no Build > Publish option to publish the website.
I've build and deployed major applications using APS.NET MVC but I can't for the life of me figure out how to deploy this simple website project as no dlls are being created.
How does one publish or deploy a website project with no Build > Publish option and no dlls created when Building?
I think it's a visual studio express thing. I don't have the build menu here at home on express but at work it shows up fine on projects.
Have you tried right-clicking on the site in Solution Explorer and observing any possible Publish Site options there?
Failing that, you might try copying the files directly to the site's root folder on the webserver.

Using references in ASP.NET with Visual Studio and TFS

I am working with Team Foundation Server and Visual Studio 2008 for the first time. I had a web site project that was done with Visual Web Developer Express, which I have converted to a solution containing a Web Application Project, setup for TFS source control, etc etc.
TFS was having issues checking in/uploading some of my referenced DDLs, specifically AjaxControlToolKit, saying things like /bin/AjaxControlToolKit.pdb couldn't be found. I removed the reference, deleted everything it had in /bin (it had created lots of folders like /ar, /cs, /de, etc etc along with other files like /bin/AjaxControlTookKit.dll), then re-added the reference to AjaxControlToolKit. It will now upload, and works fine locally, but it didn't re-create anything in /bin. I have other references that work fine and have info in /bin (ie: /References/LinqKit.dll and /bin/LinqKit.dll) I cannot do a build on the server yet, but locally it works. So, will this work when its built on the server? Why didn't it recreate anything in the /bin folder? Is that something to do with Visual Web Developer Web Site vs Visual Studio Web Application/Solution? Any info is appreciated! Thanks.
References are references, not copies of the assemblies. Where are the assemblies you're trying to work with?
Typically, you'll want to check in third-party assemblies that you are not maintaining source. You'll then want to change the file references to point to the version from source control.
Of course, this means that all your developers and build machines will need to maintain the same folder structure on disk.

Resources