System.Web.Helpers dll - asp.net-mvc

In Visual Studio 2019 for Razor pages for nuGet I see the following
System-Web-Helpers.dll
AD.System.Web.Helpers.dll
the descriptions are pretty clear but what makes me pause is the number of downloads 198k and 88k.
That seems really low for basically something I would think 100% of the Razor community would need so I am not confident that I not using the dll that most people are using.
I assume this is also being used for MVC so I would assume downloads would be in the millions.

System.Web.Helpers was released as part of ASP.NET Web Pages in 2010. It contains helpers for common tasks such as working with charts, images, caching as well has being the home of the WebGrid. While it is available from Nuget, the standard way that it was made available to Web Pages and MVC applications (MVC 3-5) was as part of the project template - hence the relatively low download numbers.
It depends on System.Web, which is part of the old .NET Framework, and is therefore not suitable for use in Razor Pages or any other type of .NET Core application.

Related

Updated ASP.NET Web Application (.NET Framework) MVC5 Project Template

The project that visual studio 2019 creates for an ASP.NET Web Application (.NET Framework) MVC5 comes with Bootstrap 3.x and many other outdated components. Not to mention unneeded things like modernizr.
If you update Bootstrap, you know need to modify the ScriptBundle in BundleConfig to get the application to start, and then modify the CSS to get the premade web pages to render properly.
Also, the folder structure is not the best.
Is there a project template out there that has all essential components updated, and a clean-up NuGet and folder structure?
I tried using Rider but they do not have a built-in template.
I went t the .Net Foundation GitHub and did not find any: https://github.com/dotnet?q=.NET+framework&type=&language=c%23&sort=
I also search GitHubub and did not see any: https://github.com/search?q=ASP.NET+Web+Application+%28.NET+Framework%29+project+template
I am looking for a project template that has the basic structure to create a Clean Architecture in .NET Framework and not .NET Core
I know it's legacy, but unfortunately, I need it for a university class (University courses take a while to get updated, and in this case, they claim that there are sufficient companies out there using ASP.NET MVC 5 to Merrit them teaching it) But yes, No one should be using this to start a new project they intend to put into a real-life production scenario.
Thank you

Best way to reverse deploy an asp.net mvc web application which is not precompiled

I have a Visual Studio 2012, MVC 3, asp.net 4.5, c#, razor web application.
The original application is a 2 project solution with 1 project being the Data layer and the other the web application. When deployed the data layer is represented as a dll.
All Controllers and Views are still in "source" format on the deployed "test" platform, since I have not precompiled the code before deploying.
I have ftped the whole site back to my dev server into a seperate area.
I did try and open this downloaded application as a project and also a website, but got some reference errors.
I do appreciate this is a non ideal state of affairs, and this codebase should be represented as a previous version in source control. However for a number of reason, we need to do this, mainly because we did not do a branch. One lives and learns.
What should be the best way to open this site in Visual Studio to work on it. Obviously I will only have the one project now, as the data project is just another DLL? I will add this fix back to my main codebase, and recommit.
Thanks in advance.

I need to deploy source ASP.NET MVC code on Azure websites, and for it to run

This may be a terribly simple question, but....
I am using MVC3, Razor, C#, ASP.NET4.5/SQL Server 2008 and deploying to Azure Websites & SQL Azure.
I need to copy all of my source code, without compilation, from my web application ie model source, class libraries and views. All additional projects such as Entity Framework DAL projects will remain as a DLL. However I do not wish to have a web application DLL since I need to edit C# code in situ, and have the site run using this code, no doubt using the JIT compiler.
The main reason is because I am doing some integration work and the 3rd party site sends a return url back, and "Localhost" is not very accessible to the outside world, so wish to use my Azure website instead.
So can I copy my web application code as source, and if so is it a matter of copying all the C# files up and removing the web application DLL?
Thanks in advance.
EDIT
Further thoughts. Azure Websites provides a container for the Worker process to operate which hosts the Application DLL which is P-Code which is then dynamically compiled to native code. So I am not sure if one can start with a source C# file like one can with a Razor View.
EDIT2
Or do I need to make the changes on my Local machine and keep republishing to Azure Websites to test the integration? A little long winded...
MVC Sites must be Web Applications, they cannot be on the fly compiled. Sorry, there is no way around this. You must compile your code into a DLL for it to run if you want to use MVC.
The reasons for this are many, but a big one is that the "on the fly" compilation model used by ASP.NET Web Site projects does not use namespaces, and namespaces are very important to the operation of MVC.
Another issue is that MVC depends heavily on static assembly references, which is also not the case in Web Site projects.
In general, ASP.NET Web Site projects are poorly supported, have a lot of issues that make them unsuitable for larger projects, and even more unsuitable for use with more advanced frameworks.

Pack my ASP.NET MVC pager into NuGet package?

I've a pager functionality I use in some of my ASP.NET MVC projects. It consists of a couple of classes and interfaces (to generalize approach to paging of different datasources) and .aspx or .chtml view.
I can put my C# code into NuGet package/library assembly but what to do with view files which can be different for different projects (different pager design, for example)? One approach is to put HTML to HTML helper, written in C#, but I don't like putting bit chunks of html into C# code.
Is it possible to put views to NuGet package or should I use recipe feature?
I've wanted to push the usage of Nuget in MVC apps to reuse MVC apps themselves not just code - views too. I did manage to pack it up but it has like dozens issues and the experience is horrible.
If you have a pager functionality built inside an ASP.NET MVC Web application project then you can just pack it up and it will pick up the Views too. It does become a lot trickier when using DI, when using Areas, when using localization (resource files don't get picked up). For instance, Area routes might get compiled and included, on the other hand the main global.asax.cs will never be included in the package (so you have to manually copy the routes over if you have them in there).
But it does include stylesheets, so you can style your pager to the default stylesheet which you include in your package and that way you have also solved the issue of design modifications.
But all in all NuGet isn't best suited to pack MVC (or classic ASP.NET webforms) apps.

Are there add-on libraries or tools available for ASP.NET MVC development?

My first experience with ASP.NET MVC and the Entity Framework has raised my interest in this framework and I would like to implement some basic applications, covering the basic requirements of real-world web applications. So far the support given by VS 2008 is already impressive.
For some areas however, it might be a time saver to use existing add-ons or libraries of all kind. Are there already commercial or open solutions which I should take a look at?
Some of them:
S#arp architecture
MVCContrib
MVC Project Awesome
Be sure to check out example projects.
Telerik has made some UI stuff too (haven't checked out yet).
You might be interested to check out other view engines like:
Spark (this one kicks a$$)
NHaml
Haack recently posted about .less - might be worth checking out for managing css
T4MVC by David Ebbo library is a nice solution how to make your asp.net mvc app more strongly typed.
For UI testing - Watin framework.
Here's Jimmy talking about implementation and solution of common problems when doing UI testing. Seems to me that he prefers Gallio + NBehave + MbUnit combo but i personally like BehaveN (it doesn't need test runner, is not tied with particular unit test framework).
HtmlAgilityPack is a nice tool if working with raw html is necessary.
MvcTurbine might simplify technical part of your asp.net-mvc project.
Found useful MvcExtensions extension made by Kazi Manzur Rashid.
For managing javascript and css - Chirpy.
Object to object mapper for MVVM support - AutoMapper.
elmah is great for error logging.
Not necessarily MVC specific, but:
MVC lends itself to take advantage of all the jQuery UI controls and pretty things.
There's also Elmah, and StructureMap for DI/IOC.
Nothing much else to add here except that xVal is a really nice validation library, utilising jQuery. My company is currently in the process of moving from a 'roll-your-own' solution to this.
There are some useful links at the bottom of this post.
Including:
MVC HtmlHelper for Gravatar
Paging HtmlHelper for ASP.NET MVC
Marquee and GridView HtmlHelpers for ASP.NET MVC
ReCAPTCHA HtmlHelper (and also a solution to use ReCAPTCHA in ASP.NET MVC)
ASP.Net MVC Extension method to create a Security Aware Html.ActionLink
CheckboxList Helper
Also, keep an eye on some of the big component developers. Telerik has a demo of some MVC components and I hear DeveloperExpress has some on the way too.
Just to add details to Telerik's MVC support:
We just kicked-off our official support for ASP.NET MVC with last week's CTP. Our new UI Extensions for MVC will aim to bring the productivity of WebForms to MVC without violating any MVC concepts. Our new extensions are built from the ground-up specifically for MVC and they will leverage jQuery on the client for all behaviors and Ajax.
Further, the Extensions are completely open source, licensed under the Microsoft Public License (MS-PL) - the same license that the ASP.NET MVC framework ships under. You can find the CTP source today on Telerik.com or on CodePlex:
http://telerikaspnetmvc.codeplex.com/
All of that said, this is our early support. We will ship the first 3 UI Extensions in November and build from there in 2010. The first planned Extensions are:
Grid
Menu
TabStrip
You can find more details, demos, and downloads on Telerik.com:
www.telerik.com/mvc
Hope that helps.

Resources