Is it possible to compile/customize the .net framework/asp net from source code - asp.net

I recently discovered that Microsoft makes the .net frameworks source code open for the public and asp net stuff too.
Just wondering is it possible to compile/customize this and use it as a replacement for the official version?
What about compiling the .net for lets say mono/linux?
What about using the asp net source to compile it with mono?

Yes ASP.NET webstack is open sourced and it can be customized as you want. Note, ASP.NET WebForms is not opensourced only WebAPI, MVC, SignalR and WebPages is open sourced. Also IIS is closed source the last I checked it.
.NET library is but just a bunch of codes and as with any code, it can be customized as necessary.
As with Mono, I am not very fond of the distant cousin of the original .NET. It feels clunky at best at the moment and keeps changing everyday. Its best to stick with Windows for .NET for now.

Related

Which version of Visual studio supports old classic ASP Project

Which version of Visual Studio can be used to open a project which is built as ASP Web project
I have Community edition 2019 Does this support ASP projects?
I know these days no one is using ASP for building web apps The purpose is to maintain an existing ASP solution for a couple of more months 9If any bug fix requests from the client comes ) and start to build a new project using the latest version of Microsoft technologies
Visual Studio
Most versions of Visual Studio support editing Classic ASP code, couple of things to keep in mind though.
Frontpage Server Extensions is no longer supported, the best approach is to use a mapped drive or better yet store the code in source control (Git, SVN etc.) and work with the code locally (can bind to a local instance of IIS).
The IDE can be quite cumbersome for working with Classic ASP as it's designed for more modern technologies.
It also has sophisticated debugging through the IDE via the "Attach to process" which will work with Classic ASP running in IIS as long as the web application has been configured correctly for debugging. See How do you debug classic ASP?.
Visual Studio Code
Another option is Visual Studio Code which is a free IDE built on the principle of open source projects for cross-platform. It's becoming a popular free IDE for many developers rivalling the likes of Atom, Sublime etc.
It's lightweight and extensible through extensions, there are already some useful extensions for Classic ASP including this one;
Name: Classic ASP Syntaxes and Snippets
Description: Classic ASP Language Support and Snippets from tmBundle
Publisher: Jintae Joo
It also has built-in support for popular source control solutions like Git and more powerful available through the extension marketplace that is built into the IDE. If you do use Git would recommend installing the GitLens extension.
Every version of visual studio since I started with 2010 (was there something before it?) handles Classic ASP just fine. I'm on VS2019 right now.
I even have a project which is a combo Classic ASP, Webform, and MVC all in one project, with some session sharing, and I routinely code and debug in all. The only limitation is that when you debug, you have to choose whether you're debugging Managed code or "script".
With each I "attach to process" and choose which code I want to debug. Classic ASP debugging is fantastic, and I can't believe more people don't do it. I see basic questions on here which would easily be fixed with standard debugging techniques (settings breakpoints, evaluating variables).
The ONLY thing which isn't supported is code formatting inside <% %> blocks. If I ever get some time maybe I'll make an addon for it.

Is there any disadvantage in a long term to develop .Net core app which targets Net461?

I am trying to generate Well formatted Excel files from .Net Core and found ClosedXML library which runs only on .Net 4.61
I already tested the following libraries which work on .Net Core
OpenXML - Too many codes for a simple task and difficult for me to use
SyncFusion - Public / Government Organisation cannot use for free.
I changed the target to Net461, do the dotnet restore and all my codes are still running as usual and I could generate the Excel file with ClosedXML too.
What I would like to know is, is it a good approach? This is not a one-off small project and I am likely to maintain this website for another 3-4 years at least.
Is there any potential to lose the new functionalities and not able to use new Libraries from .Net Core in the future?
Or should I create another separate website running on Net461 and call that URL from my .Net Core app? So, I don't need to worry about losing new .Net Core functionalities in the future.
There is obviously no way to know the future, but the biggest thing you get with .Net Core over the full framework is the ability to run the app cross platform. So if cross platform isn't a concern, then going with the full framwork shouldn't be an issue. There is no question that the full framework will be fully supported for the 3-4 year time horizon you mentioned, in fact I think most developers would feel comfortable using the full framework even for a project with a much longer time horizon.
With regard to missing out on new .Net Core features, many of the features can be accessed even from libraries compiled for the full framework. For example I use the new encryption libraries found in Microsoft.AspNetCore.Cryptography (that are part of .Net Core) from my full framework class library. The net .Net Core libraries are just Nuget packages and as such can be referenced from non .Net Core projects.

How to port to .NET core?

I was looking for possibilities for porting some web projects from Windows .NET framework to Ubuntu linux using open source .NET core
After a lot of struggle with Mono, which I have almost gave up. I was looking at .NET core as a new hope. Have anyone of us ported from .NET to .NET core?
If yes, can the possible problems like the ones I faced with Mono be shared?
Moving from .NET to .NET Core is a huge move, especially if you're going to take advantage of Core. There is not currently a one click port, and I doubt you'll ever get a one-click migration like migrating from a VS 2013 project to a VS 2015 project. The entire startup flow is different, and to automate switching to that would be incredibly difficult. For now, the way I am looking at it is that moving to .NET Core is essentially a rewrite. As to whether that is worth it to you for your project - well that's really hard to say and also probably not well suited to that site.
That said, if you do rewrite you can probably bring along a lot of your business logic. You just will need to redo a lot of the other structure.
There's no easy way to move a project from .NET Framework to .NET Core. Possibly you'll need to rewrite or start from scratch.
There are some major differences between two
Format of configuration files (web.config vs appsettings.json)
Used libraries
Startup files (Global.asax vs Startup.cs)
Lack of static objects in .Net Core. Like Session and Application
objects - which is a good thing btw.
Many of the .Net Framework libraries are dependant on
app.config/web.config files

Can we compile an asp.net 5 application by .net native?

The role of .net native in .net ecosystem is confusing for me. I heard it is just for universal windows applications, but also heard that it is part of CoreFX. I think having the option to compile to .net native can have many advantages (including performance).
Is it possible to compile my asp.net application (specially asp.net 5) to .net native?
No, you cannot. Right now, .NET Native is not for ASP.NET. I believe it's only for Universal Windows Applications. That doesn't mean that one day it won't be available, but right now it's not planned.
See related GitHub issue where ASP.NET team confirms this.
Edit 11/27/2015
Since this was posted, Microsoft has made further announcements regarding .NET Native and .NET Core. I suggest you check out Scott Hanselman's part of the keynote from the Microsoft Connect 2015 event. At the 11:22 minute mark of this excerpt video Scott shows compiling an .NET app to native code and then running it. He says it's "future work" so it appears it's not quite ready yet (I believe one of the Q&A videos from the event explained that it's in one of the dev branches on GitHub, but I'm too lazy to rewatch all the videos for you at the moment). It was unclear if this is only working for console apps at the moment or if it will run ASP.NET.
As Thomas says in comments, this should be possible once LLILC is out. It targets .NET Core which is what ASP.NET 5 runs on. I am not sure if the resulting runtime can be called .NET Native per say but LLILC do has plans to natively compile IL (e.g. output by Roslyn) ahead-of-time.
Another option is ASP.NET running on CoreRT by using RyuJIT as AOT compiler. This looks closer to reality today than LLILC. Have seen some experiments in compiling ASP.NET project on CoreRT but nothing that actually works.
[.NET Native makes use of UTC compiler which compiles to run on some C++ runtime (MRT - either minimal runtime or managed runtime, cant remember, also known as Native runtime). Currently the .NET Native UWP apps are windows specific. Though .NET Native and UWP are advertised under .NET Core, this could be misleading as only in debug mode UWP targets CoreCLR, in release mode it targets native runtime which is Windows specific. LLILC/CoreRT should change that.]

Compiling ASP.NET

I'm compiling ASP.NET code for the first time ever and I'm stumped.
I downloaded MINGW-Get and just finished installing it. The client gave me the source code and I found a file called RSConfig.exe.
So I assumed that was the config file, ran it, and then tried "make" but got the error
No targets specified and no makefile found. Stop
Any idea what I'm supposed to do? I don't see anything that would resemble a makefile in the source code.
Thanks in advance!
Do yourself a favour and install Visual Studio Express:
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/express
It makes development easier and fast
It sounds like you might want to get familiar with the background concepts around asp.net and it's defacto development environment Visual Studio (there are many versions of visual studio).
As Andrei recommends, using Visual Studio Express is a good free way of getting started. The version most suited for web development is Visual Web Developer Express.
Attempting to compile .net code from a toolset such as MinGW isn't a typical route for using asp.net, however I've not used MinGW before and not sure it's possible to compile .net code from it.... Although it is perfectly possible to compile .net code from the command line (using the .net framework sdk) , I certainly wouldn't recommend it if you are getting started.
I'm going to make a guess that it is an ASP.net web forms project, it being the most prolific asp.net project type at the moment.
This official asp.net site http://www.asp.net/web-forms will guide you through what web forms are and how to get the development environment setup. Having this sort of background will aid you in solving your particular situation.

Resources