How to create 2.0 Standard project referencing core library and using 2.0 standard in 4.8 framework project example

Spunny

New member
Joined
Nov 25, 2024
Messages
2
Programming Experience
10+
Hi,
We have 4.8 framework asp.net project\application. Have done few business logic in core project. Need to reference core library in 4.8 framework asp.net project and use that code.
So confusing when I read articles. 2.0 standard console project can be used as bridge. Can some one provide me websites with complete examples of how to do it.
Do I need to write code in 2.0 standard console project?

TIA
 
.Net Standard is only relevant for class libraries. Version 2.0 is the last that supports .Net Framework apps, .Net apps can use that too.

1732559998703.png


Within a solution you can use project reference, from a different solution you can reference the library (dll) directly or as a Nuget package if you have published that.
 
Thanks John. Is there an example of 2.0 standard project code. Some say, need to create view models for .core objects. So, not sure exactly where to start or what to do.
 
You just create a regular class library (and target .Net Standard).

As outlined in article the API is more limited than if you created for example a .Net Framework 4.8 library or a .Net 8.0 library since it must support any .Net implementation listed for that version.
 
Back
Top Bottom