简体   繁体   中英

.NET naming conventions for solution with .NET Standard, .NET Core and .NET Framwork Projects

I have found nothing on the web about the accepted naming conventions for a .NET solution which contains .NET Standard, .NET Core and .NET Framework projects.

In my case we had the following convention in our .NET Framwork project:

[CompanyName].[TechnologyName].[Feature]

Now we want to port this to .NET Standard and .NET Core. Not all of the classes inside the feature work on all of them, so we have a .NET Standard project which is referenced by the .NET Core project. The .NET Core project is then reference by the .NET Framework project. How should we now name our projects.

One solution would be to include the name of Standard or Core in the namespace:

[CompanyName].Standard.[TechnologyName].[Feature]
[CompanyName].Core.[TechnologyName].[Feature]
[CompanyName].[TechnologyName].[Feature]

or

[CompanyName].[TechnologyName].[Feature].Standard
[CompanyName].[TechnologyName].[Feature].Core
[CompanyName].[TechnologyName].[Feature]

But we want to know if there is a global naming convention for this.

I think the original guideline still stands. Take the sample Microsoft.AspNetCore.Mvc . That is company, product and whatever below. .NET Standard or .NET Core version should be shipped under the same name just packaged for their target framework moniker. Take the sample of Newtonsoft.Json . If the API surface/feature set changes, go for a breaking version change or change the product name.

Don't get confused by the Core additions at Microsoft product names. They choose to make ASP.NET Core, .NET Core and EF Core new products to avoid misleading assumptions of a higher product version: ASP.NET 5.

Listening the ASP.NET community standup I can tell you that this topic came up and they concluded that not everything should be added a Core naming part.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM