I am figuring out architectural components for my new web project. I am thinking to go with ASP.NET Core 1.0, EF7 stack. Some people suggest that ASP.NET Core 1.0 is in it's initial stage and it's not recommended to use it in enterprise web applications presently. Same opinions I heard in case of EF7 as well.
Mainly I want to know the disadvantages. Experts please explain the pros and cons of using ASP.NET Core 1.0 at present.
Somewhere they are true and somewhere they are wrong. ASP.NET Core is targeted by 2 frameworks .NET Core and .NET Framework. Both options are available in Visual Studio. You have to carefully choose, what is right for your project. Here are some differences\suggestions with ASP.NET Core and EF Core (EF 7 previously):
All .NET Framework Libraries (BCL or FCL) are not yet available for CoreFx (.NET Core library) but soon they will be available as the .NET team announced.
If your project uses .NET Framework libraries such as MailMessage and others, the use ASP.NET Core targeted with .NET Framework not .NET Core then you will be able to get all the features of .NET Framework in your ASP.NET Core application.
ASP.NET Core uses modern web work-flow for reducing page load times and for other attributes some of them are not available with the previous versions of ASP.NET.
EF Core 1.0 is new and cloud-optimized, it does not include (at least for now) featues which are available in EF 6.x such as Stored Procedures Mapping, Built-In feature for Seeding data and others.
If you want commercial projects that strongly rely on EF 6.x features which are not available now in EF Core, you can use ASP.NET Core 1.0 with .NET Framework with EF 6.x. I've a websites also created with ASP.NET Core with .NET Framework.
Here are some documentations for using ASP.NET Core 1.0 with EF 6.x and suggestions.
Related
Is it possible to work with clean architecture in ASP.NET MVC 5 on the .NET Framework 4.5 and 4.7.2? I ask the question because I see more examples on .NET Core.
Thanks
I prefer known work clean architecture for .NET framework 4.7.2 for an ASP.NET MVC 5 project written in C#.
I'm still getting to grips with .Net Standard vs .Net Core after many years of development ASP.NET Framework. I have set up a new Web Api "app" which targets netcoreapp3.1 framework along with a middle-tier/Business Logic ClassLib and Data Access ClassLib, both of which target .Net Standard for maximum future compatibility. However, I can't seem to use ISystemClock from the Microsoft.AspNetCore.Authentication namespace in the .Net Standard classlibs!
From reading this SO question, I believe this might be because netstandard2.0 might not implement Microsoft.AspNetCore.App framework. Is this correct?
If it doesn't, should I:
Provide my own IMySystemClock interface in my class libraries which
the "app" itself can implement a trivial concrete class for?; or
Change my class middle and data access tiers to netcoreapp3.1
framework (seems over kill and restrictive to do this)?
Something else? Maybe I am missing the point of .Net Standard`?
A service (like ISystemClock) to provide the current (real or mock) time seems quite a fundamental service so I'm unsure why it's not appearing in .net standard framework?
Thanks
BloodBaz
If you want to access that functionality from a library, change the target framework of your library to .NET Core 3.1. Libraries can be built in .NET Standard or .NET Core. You can't use .NET Core functionality within a .NET Standard library, but you can do the reverse. Use .NET Standard functionality within a .NET Core library.
Also as a side note, unless it's required for compatibility reasons, I recommend you switch to .NET Standard 2.1. Visual Studio defaults new projects to .NET Standard 2.0, but a ton of new functionality was added in .NET Standard 2.1.
I spent years in the .NET Framework, so I feel the confusion. It took me a while to get used to it. I have a huge project I recently migrated over from .NET Framework to .NET Standard / .NET Core. What I ended up doing was dividing my code up into three sections. A .NET Standard 2.1 library with all the non .NET Core specific common code, a .NET Core 3.1 library with all my .NET Core specific common code (which referenced my .NET Standard library), and my applications as .NET Core 3.1 projects (which referenced my .NET Core 3.1 library).
Make sure you take a read at the answer in this question as well: What is the difference between .NET Core and .NET Standard Class Library project types?
I'm not finding any clear answer on this. On the Compatibility page, they say:
Everything in .NET 4.7 except WPF, WWF, and with limited WCF and
limited ASP.NET async stack
What about .NET Core 2.2? Is it possible to run it on MONO or not?
I'm glad .NET Core framework is becoming more mature; but unfortunately it doesn't support legacy WebForms, and MONO's support for Core is unclear, so they don't mix well.
Mono 5.4 implements netstandard 2.0. Since ASP.NET Core 2.x runs on netstandard 2.0, Mono 5.4 also does support ASP.NET Core 2.x.
Note that starting with ASP.NET Core 3.0, the framework will only run on .NET Core. That means that if you want to stick to Mono, you will have to stick with ASP.NET Core 2.x.
Since ASP.NET Core 2.2 is not a long time support (LTS) release, which means that it will run out of support not too long after 3.0 releases, I would recommend you to stay on ASP.NET Core 2.1 if you want to run it on Mono.
That being said, there isn’t really a reason for you to run on Mono there. You can just use .NET Core properly. If you need Mono around for other WebForms projects, then you can just do that for those projects. But for ASP.NET Core, you can just choose the .NET Core runtime. Because in the end, ASP.NET Core and WebForms will not mix, even if you run both on Mono.
I wanted to understand the dot net core support a bit more.
My basic understanding was that if I wanted to run a .net app on Linux then it needs to be built .net core and targeted netcoreapp1.0 framework to guarantee this.
1) I assume the above assumption is correct?
2) When I was reading various articles online, such as this one about referencing exiting .net framework project within a .net core application (https://www.hanselman.com/blog/HowToReferenceAnExistingNETFrameworkProjectInAnASPNETCore10WebApp.aspx)
If I did this, presumably the app would only run on Windows and not Linux?
3) In the following article:
https://blogs.msdn.microsoft.com/cesardelatorre/2016/06/28/running-net-core-apps-on-multiple-frameworks-and-what-the-target-framework-monikers-tfms-are-about/
In context to running with .net run 4.5.2 option (
dotnet run -f NET452), it's mentioned:
If this app were running on the .NET Core Platform, let’s say on a Linux box or a Mac, this code won’t be executed, but the app would
still be running on Linux or MacOS.
What's the distinction between running and not executing? If my initial understanding was correct, then by running with .net 4.5.2 option on Linux I wouldn't expect the app not to run at all.
Appreciate a few questions there but really wanted to understand .net core a bit more.
There is a difference between .NET Core and ASP.NET Core and the articles you mentioned are about running ASP.NET Core "apps" on .NET Framework. Let my try to clarify this using a few declarative statements:
.NET Core is the cross-platform runtime.
ASP.NET Core is a set of libraries that until version 1.1.* can run
on both .NET Framework and .NET Core.
This means you can create a .NET Framework application (=> e.g.
net452) and use ASP.NET Corein this application.
The CLI tooling works for both projects targeting netcoreapp* and
net* - but net* currently only works on windows.
This means that for netcoreapp1.*, you cannot reference arbitrary libraries that have been built for .NET Framework. If you change the target framework to say net452, you are no longer building a .net core application, but a .net framework application.
For ASP.NET Core 2.0 this is going to change. Again a few statements:
ASP.NET Core 2.0 is still a set of libraries but they can only be used on .NET Core 2.0 and not on .NET Framework
Do note that this is still under discussion at the time of writing: https://github.com/aspnet/Home/issues/2022
.NET Core 2.0 is able to freely reference libraries that have been built for .NET Framework up to version 4.6.1
However, some libraries may fail at run time if they try to use API methods that aren't available on .NET Core
I have recently started doing Research and Development on ASP.NET vNext and I am trying to understand following:
How is ASP.NET MVC vNext cloud optimized?
What are major changes to the .NET Core, .NET 4.6 that ASP.NET MVC vNext are called cloud optimized?
What is meant by the fact that ASP.NET MVC, Web API and Web Pages now share a unified core? Whats the advantage of that?
Kindly help me understanding these concepts from a beginners point of view.
vNext apps can use a cloud-optimized subset of the .NET framework. This subset of the framework is about 11 megabytes in size compared to 200 megabytes for the full framework, and is composed of a collection of NuGet packages.
It is not required that you use this subset of the framework you can still use the full framework depending on what parts of the framework your application needs.
Previously there was a moderate amount of duplicate concepts between MVC and WebApi. The routing systems and framework extension points where very similar but different implementations. They are now the same framework. You can return MVC and WebApi results in the same controller if you want. Web Pages will be added to MVC 6 in a later release.
ASP.NET 5 (Panel Discussion)
http://channel9.msdn.com/Events/Visual-Studio/Connect-event-2014/023
Five Essential Things to know about ASP.NET vNext (David Fowler Damian Edwards)
https://vimeo.com/113688715
ASP.NET vNext 101 (Damian Edwards, David Fowler)
http://channel9.msdn.com/Events/dotnetConf/2014/ASP-NET-vNext-101
The .Net Core is a subset of the .Net framework similar to the BCL that has been open sourced and is supported by Microsoft on Windows, Linux and Mac OSX
Introducing .NET Core
http://blogs.msdn.com/b/dotnet/archive/2014/12/04/introducing-net-core.aspx
Edit: New Video from NDC confrence on June 19, 2015
What’s new in ASP.NET 5 and MVC 6 - Jon Galloway and Damian Edwards
https://vimeo.com/131199086