Skip to content

GitVersion throws errors MSBUILD : Task factory warning NMSBT010: There is a mismatch between SDK NuGet version (4.8.0) and the NuGet version the task factory was compiled against (4.6.0). There might occur some exotic errors. #1467

@ngeegoh

Description

@ngeegoh

I have installed GitVersionTask (4.0.0-beta0014) in VS17. I have many projects (different packages) inside the VS solution. When I ran dotnet build, I got this error:
MSBUILD : Task factory warning NMSBT010: There is a mismatch between SDK NuGet version (4.8.0) and the NuGet version the task factory was compiled against (4.6.0). There might occur some exotic errors.
I have googled but still could not find the solution for this. Just wondering if this the issue with GitVersion when running in VS?? To be more specific, I added a gitversion step in my cake script (set the updateAssemblyinfo to TRUE), then when it moved to the dotnet build step, it threw the above error. When I checked the assemblyinfo.cs in VS, I can see GitVersion added the version in that file but it was complaining because it did not have System.Reflection imported. I tried to import that namespace and re-ran it, it also threw an error "duplicated System.Reflection" ? It did not add that namespace before and when I added it, it complained.

Another question is what would be the best practice if I want to version different packages (increment based on their changes, so I assume every package inside that repository will have different version number) and get them built in VSTS? At the moment, I can add GitVersion step in VSTS to get the SemVer version and then pass that value in the packing step. However, the process will pack ALL packages with the same version number not version them individually.

For example, let's say I got 3 projects (MyComponetA, MyComponentB and MyComponentC) under one repository called Apple. I made some changes in MyComponentB and want to increment the MINOR, and keep the version of others the same as no changes made. When I build Apple repository in VSTS, after packing and pushing, I expect to see MyComponentB's minor version incremented and others' versions could be either remain the same version or version with metadata(build number).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions