This article is a mirror article of machine translation, please click here to jump to the original article.

View: 656|Reply: 0

[Tips] .NET/C# Solution Project Import References (Unified Version)

[Copy link]
Posted on 2025-6-1 16:51:30 | | |
Requirements: Extract common content from projects in C# solutions, such as .NET versions, reference public libraries, etc. Application Scenario: There are 10 projects below the solution, 10 projects are all .NET 8 versions, if you want to upgrade to .NET 9 version, you need to change the .csproj file of 10 projects, if you use Import encapsulation to reference the configuration of a template, you only need to change the template configuration.

Review:
.NET Project Setup Central Package Management (CPM)
https://www.itsvse.com/thread-10743-1-1.html

Tips to discover while looking at dnSpy projects. Reference:The hyperlink login is visible.

Solution Items:ConsoleAppItsvseClassLibrary1ClassLibraryCommon。 (ConsoleAppItsvse and ClassLibrary1 both refer to ClassLibraryCommon)

Previously configured

ConsoleAppItsvse configuration before modification:

ClassLibrary1 configuration before modification:

ClassLibraryCommon configuration before modification:

After that, it is configured

Create a new one under the solution catalogConfigCommon.propsfile (name arbitrary), configured as follows:

ConsoleAppItsvse modified configuration:

ClassLibrary1 modified configuration:

ClassLibraryCommon modified configuration:

Reference:The hyperlink login is visible.




Previous:[Nexus3] (1) Deploy Nexus tutorial with Docker installation
Next:Introduction to BitLocker security technology for Windows systems
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com