[Tests] Local Testing of single Mapster Projects fails for SolutionDir is not always set when building a project directly via dotnet test
@DevTKSS ya está trabajando en esto.
Desde el 18/1/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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 is not always set when building a project directly (e.g. `dotnet test path/to/csproj`).
Fall back to the key path relative to this props file (src/Mapster/Mapster.snk).
-->
<AssemblyOriginatorKeyFile Condition="Exists('$(SolutionDir)Mapster\\Mapster.snk')">$(SolutionDir)Mapster\Mapster.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile Condition=" '$(AssemblyOriginatorKeyFile)' == '' and Exists('$(MSBuildThisFileDirectory)Mapster\\Mapster.snk')">$(MSBuildThisFileDirectory)Mapster\Mapster.snk</AssemblyOriginatorKeyFile>
Which includes in the .csproj the marked lines:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0;net9.0;net8.0;</TargetFrameworks>
<Description>Dependency Injection supports for Mapster</Description>
<IsPackable>true</IsPackable>
<PackageTags>Mapster;DependencyInjection</PackageTags>
+ <SignAssembly>true</SignAssembly>
+ <AssemblyOriginatorKeyFile>Mapster.DependencyInjection.snk</AssemblyOriginatorKeyFile>
<Version>10.0.0-pre01</Version>
</PropertyGroup>
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?
- Lenguaje dominante
- C#
- Estrellas
- 5.2k
- Forks
- 409
- Merge medio
- 3 d 4 h
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MapsterMapper/Mapster
-
.NET MatrixAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
MapsterMapper/Mapster#1003 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
MapsterMapper/Mapster#1024 · 1 comentario ·
-
[Mapster Tool] Add support for global:: to disambiguate type names in generated mappersPosiblemente ocupada @DocSvartz la tomó hace 2 días. Abiertoimprovement
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
MapsterMapper/Mapster#1020 · 3 comentarios ·
-
Mapster.Tool - PropertySettingBuilder.Map(member, mapFunc, targetPropertyName) method is not working as expected!Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
MapsterMapper/Mapster#1017 · 6 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 57/100
MapsterMapper/Mapster#1007 · 5 comentarios ·
Todos los issues de MapsterMapper/Mapster
Issues similares
-
bug ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
CodeForFire/lagebuch#714 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
dimitar-radenkov/Pointframe#294 ·
Los mantenedores suelen responder en 1 día
-
Batteries can't be swappedAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
Okabintaro/SubmersedVR#253 ·
-
S: Untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
Los mantenedores suelen responder en 2 días
-
Remove Extract Data capabilitiesAbiertomaintenance
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
hyjinx-emu/Hyjinx#398 ·
Los mantenedores suelen responder en 1 día