MapsterMapper / MapsterMapper/Mapster

[Tests] Local Testing of single Mapster Projects fails for SolutionDir is not always set when building a project directly via dotnet test

Open
#848 10 comments 0 reactions 1 assignee View on GitHub

@DevTKSS is already working on this.

Since Jan 18, 2026.

improvement
Dominant language
C#
Stars
5.2k
Forks
410
Avg merge
2d 12h
Merged PRs (30d)
6

Description

I was locally trying around with the DI Package to look into my suggested Idea to enable something like `MapsterOptions` from `appsettings.json`.

But testing via `dotnet test path/to/csproj` fails on the `Directory.Build.props` file uses `SolutionDir` which is not or not always set, which causes that Copilot constantly edits the `Directory.Build.props` with this:
```

$(SolutionDir)Mapster\Mapster.snk
$(MSBuildThisFileDirectory)Mapster\Mapster.snk
```

Which includes in the `.csproj` the marked lines:
```diff


net10.0;net9.0;net8.0;
Dependency Injection supports for Mapster
true
Mapster;DependencyInjection
+ true
+ Mapster.DependencyInjection.snk
10.0.0-pre01

```

Since I so far never worked with Signing Assemblys or similar, I don't know for what build/release step we are exactly needing this, assuming just for the Package Creation - Release step, isnt it?

I am quite sure @andrerav or you others @DocSvartz @stagep might have some information and solution? 😁

How do you do this when you others are testing locally?
Is there some kind of trick, except from always building the solution? 😓
Could we have this fixed possibly?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.