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
@DevTKSS is already working on this.
Since Jan 18, 2026.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.