Home > front end >  How to use global.json in Visual Studio 2022 to set SDK minor version when publishing project?
How to use global.json in Visual Studio 2022 to set SDK minor version when publishing project?

Time:09-23

According to Microsoft, using global.json is the correct way to publish with a specific minor version. However, i have searched the documentation but cannot find to include the file after creating it in Visual Studio 2022 when publishing the project. How can this be done?

CodePudding user response:

From the docs:

The global.json file allows you to define which .NET SDK version is used when you run .NET CLI commands.

That is, when you build your app.

If you want to specify the runtime version instead of the SDK version, you should use target frameworks.

If you do want to specify the SDK version used to build the app, you could manually create a global.json file and add it to the current working directory as explained in the docs. The Publish wizard in Visual Studio won't do this for you.

  • Related