Skip to content

GitVersion fails to install in non-core project.json project #1040

@twsouthwick

Description

@twsouthwick

I'm using project.json for a non-core project since it's easier to manage dependencies. However, GitVersionTask fails to install with the message:

Package GitVersionTask 4.0.0-beta0007 is not compatible with net45 (.NETFramework,Version=v4.5). Package GitVersionTask 4.0.0-beta0007 supports:
  - linux (linux,Version=v0.0)
  - osx (osx,Version=v0.0)
  - win32 (Windows,Version=v3.2)
One or more packages are incompatible with .NETFramework,Version=v4.5.

I took a look at the structure of the nupkg and saw that it is:

│   GitVersionTask.dll
│   GitVersionTask.dll.config
│   GitVersionTask.nuspec
│   GitVersionTask.pdb
│   [Content_Types].xml
│
├───build
│   ├───dotnet
│   │       GitVersionTask.targets
│   │
│   └───portable-net%2Bsl%2Bwin%2Bwpa%2Bwp
│           GitVersionTask.targets
│
├───lib
│   ├───linux
│   │   └───x86_64
│   │           libgit2-381caf5.so
│   │
│   ├───osx
│   │       libgit2-381caf5.dylib
│   │
│   └───win32
│       ├───x64
│       │       git2-381caf5.dll
│       │       git2-381caf5.pdb
│       │
│       └───x86
│               git2-381caf5.dll
│               git2-381caf5.pdb

Putting the libgit2 libraries under lib seem to mess it up as it thinks it only supports Linux/osx/win32 which does not align with the framework names (ie net45). I got it to work by moving the lib folder under the build/[framework] folder:

│   GitVersionTask.4.0.0-beta0007.nupkg
│   GitVersionTask.4.0.0-beta0007.nupkg.sha512
│   GitVersionTask.nuspec
│
└───build
    ├───dotnet
    │   │   GitVersionTask.dll
    │   │   GitVersionTask.dll.config
    │   │   GitVersionTask.pdb
    │   │   GitVersionTask.targets
    │   │
    │   └───lib
    │       ├───linux
    │       │   └───x86_64
    │       │           libgit2-381caf5.so
    │       │
    │       ├───osx
    │       │       libgit2-381caf5.dylib
    │       │
    │       └───win32
    │           ├───x64
    │           │       git2-381caf5.dll
    │           │       git2-381caf5.pdb
    │           │
    │           └───x86
    │                   git2-381caf5.dll
    │                   git2-381caf5.pdb
    │
    └───portable-net+sl+win+wpa+wp
        │   GitVersionTask.dll
        │   GitVersionTask.dll.config
        │   GitVersionTask.pdb
        │   GitVersionTask.targets
        │
        └───lib
            ├───linux
            │   └───x86_64
            │           libgit2-381caf5.so
            │
            ├───osx
            │       libgit2-381caf5.dylib
            │
            └───win32
                ├───x64
                │       git2-381caf5.dll
                │       git2-381caf5.pdb
                │
                └───x86
                        git2-381caf5.dll
                        git2-381caf5.pdb

I understand this is duplicating the files, but the install will work on non-core projects using project.json if done this way

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