Closed Fennixx closed 1 year ago
What kind of project is this ? Class library or console application?
What kind of project is this ? Class library or console application?
Hello, it is class library.
Try to add msbuild property that copies all dependencies to output folder :
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
Thanks, yes I confirm, that fix my issue.
I'm not sure this is what you want to do...
You MIGHT have it as -p
property when building assembly to generate the mapping BEFORE building your project, but definitely NOT as property in your main project.
So how should this config looks like? We are using it now with this configuration:
<Target Name="Mapster">
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet build" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet tool restore" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster model -a "$(TargetDir)$(ProjectName).dll"" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster extension -a "$(TargetDir)$(ProjectName).dll"" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster mapper -a "$(TargetDir)$(ProjectName).dll"" />
</Target>
Something like this I think :
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet build -p:CopyLocalLockFileAssemblies=true" />
Hello, I am facing issue that mapper cant be generated when at least one of the mapped entities have any using, so any external dependency. We are corrently using Mapster:7.4.0-pre06 with MapsterTools:8.4.0-pre.6 due to .NET7 need. We have all the project in .NET7. Corrently we found one workaround and that is that we need to manually copy all the required dependencies to bin folder. Then it works.
We have following error for each dependency: (replace
<myDependency>
with any dependency you can imagine)