.Net implementations

I have worked for two companies that implement ASP.Net in two different ways. I'm leaning towards A, but my current work follows B's (more typical) approach. I am wondering which is the best and also are there formal names for these implementations?

A) No project or solution was created. We just pointed Visual Studio to a directory and started creating pages (we had a combination of aspx embed pages and aspx / code-behind pages). We were just pushing files to the server and that was it. All classes and services sat in the App_Code or Bin directory if we need any third party functionality. We never used the "build" function in .Net and it was JIT for the most part. Debugging was done in the old school style of Response.Write ().

B) The project is created. There are Resx files, sln files and project files, etc. The project is compiled, built and debugged, so I'm sure most of the .NET developers are using. Everything is very specific to the VS IDE and trying to open a "project" in another copy of Visual Studio requires the same localhost directory / settings as the one who created the project.

It would be interesting to hear from people who have worked in both implementations and the benefits they find on both sides.

My reason is because I think I want my current dev team to focus more on the A implementation and cut out all those peripheral files and configurations that are blocking you in VS, but I am also open to learning about the benefits of using Microsoft Kool- Aid.

+1


source to share


8 answers


I've used both approaches for good reason, but frankly, B) is preferred over A).

If you are developing code that you then hand off to a client with limited development capabilities, then A) (which we call a website project) might be the best way to go, and also keep everything else as simple as possible.



However, if you are developing an application in which only your company will be working on code, you really want to learn how to get along with Approach B) (which we call a web application).

A web application project gives you more control over what is in the project, what is actually published and, importantly, can lead to better testing. Instead of trying to convince your colleagues to stay away from web applications, I suggest that you take this approach. Avoid releasing code in the App_Code file and in your code. Build and release assemblies, add solution libraries to projects.

+7


source


I'd rather "lock myself" in Visual Studio than lose my debugger. How often do you guys need to develop outside the sun? I think never. You are already using MS products, use them the way they were intended to be used.



+3


source


If you are using ASP.NET, you are already "writing Microsoft Kool-Aid" or at least sipping on it for a bit.

With A, you primarily use Visual Studio as a glorified text editor, with all the debugging, organizing, and other work done by hand.

With B, you can use all the debugging and editing features in Visual Studio. The downside is that Visual Studio has its own way of doing some things that are initially forced upon you; though with some effort you can change the project settings to act however you want.

In any situation, you need to compare what you get and what you lose. In the case of going from A to B, you lose a little flexibility, but you get a ton of debugging options.

+3


source


Check out this question and answers a couple of days ago ...

+2


source


My preference is for Method A. I like to keep things as simple as possible. With Method A, I know that whatever is required in the directory is needed for the website. With B it is possible to exclude files from the project, but there are still those files in the directory. I think this is confusing if you are looking at the site from Windows Explorer.

With A it is easy to install a small patch to a page. With B, you need to recompile the project and redeploy. Because of this, A allows you to modify and deploy with any editor. B requires you to use VS.net.

B introduces more dependencies and complexity, which can lead to more non-site code issues.

A plays well with any source control. With B, I had problems with the project and solution files. B also adds files to the project that are not needed for the website.

With A and B, you can use VS.net for debugging. No need to use response.write with A.

+2


source


I use both too. Option A is really the way to go if other people will serve the site once you've done it, as Anthony said. Option b makes the development process a lot easier, and for me personally, I think you get more performance out of option B.

+1


source


You are making a false statement about how B) works:

trying to open a "project" in another copy of Visual Studio requires the same directory / localhost settings as the one who created the project.

This is not entirely true. Important settings need to be included in the solution, and while you need the same folder structure that is truly part of the project and not the burdensome burden you are hinting at. It's usually pretty easy to move projects between developers. At least not more complicated than a desktop application with a similar scope.

This is especially true if you are using a control source. Just check out the project and any folder structure you worry about should come with it.

0


source


"Everything is very tied to the VS IDE and trying to open a 'project' in another copy of Visual Studio requires the same directory / localhost settings as the one who created the project"

Not in my experience. The directories should be the same within a web project, but that's the case for any web application. If you are talking about third party links (like dlls), you can simply create a folder called Links and leave them there. This way everyone will point to the same folders (in relation to a local project ... it doesn't matter if you save the project in a different directory like someone else).

As for the localhost settings ... I'm not sure what you are getting at. How is Method A different from Method B regarding web server settings?

0


source







All Articles