最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

docker - Why do I get a the wrong .Net core version reported when specifying the correct container tag? - Stack Overflow

programmeradmin1浏览0评论

In my build pipeline I pull this container:

mcr.microsoft/dotnet/sdk:8.0.405

When I run dotnet format --version within that container I get the following version number:

8.3.546805+86f5186deeea364bd8541d51657e52a54b2a96b2

Why would I get .NET format version 8.3 when I am specifically asking for container version 8.0.405 ?

Locally I have the .Net SDK installed at version 8.0.405 and when I run dotnet format --version I correctly get:

Welcome to .NET 8.0!
---------------------
SDK Version: 8.0.405

I just do not understand what the discrepancy is.

This is causing me an issue as the format command behaves differently on my build server to running it locally but the versions should be exactly the same.

In my build pipeline I pull this container:

mcr.microsoft.com/dotnet/sdk:8.0.405

When I run dotnet format --version within that container I get the following version number:

8.3.546805+86f5186deeea364bd8541d51657e52a54b2a96b2

Why would I get .NET format version 8.3 when I am specifically asking for container version 8.0.405 ?

Locally I have the .Net SDK installed at version 8.0.405 and when I run dotnet format --version I correctly get:

Welcome to .NET 8.0!
---------------------
SDK Version: 8.0.405

I just do not understand what the discrepancy is.

This is causing me an issue as the format command behaves differently on my build server to running it locally but the versions should be exactly the same.

Share Improve this question edited 11 hours ago marc_s 755k184 gold badges1.4k silver badges1.5k bronze badges asked 18 hours ago RemotecRemotec 10.8k28 gold badges117 silver badges159 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

dotnet --version prints the SDK version which is 8.0.405.

dotnet format --version prints out the version number of the dotnet-format command which doesn't necessarily match the SDK version. In your case, the container version is newer than the one you've installed locally.

Each part of the SDK has it's own version number which is very clear if you do dotnet build --version which will print out 17.11.9.46202 in the 8.0.405 container.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论