Closed bhavens17 closed 1 year ago
I was able to compile your sample project using a pre-release version of Mapster.Tool.
At the Developer Command Prompt:
dotnet tool uninstall Mapster.Tool dotnet tool install Mapster.Tool --version 8.4.0-pre05
However, without any mapping definitions defined in your sample project, this is just avoiding the compilation error and not showing that the tooling is working. It will probably be necessary to also update Mapster to pre-release version 7.4.0-pre05.
@bhavens17 Let me know if you are still having issues after trying the pre-release version.
I am currently running into this on 7.4.0-pre05 and 7.4.0-pre06.
Adding
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
to the affected project currently remedies the issue. However, I would consider this to merely be a workaround, not a fix, since a lot of (unneeded) DLLs are copied to the build output.
@kescherCode While I can see this from your point of view, you might want to consider refactoring your code to minimize the amount of third party dependencies from the classes you are trying to map. Consider using partial classes or extension methods in separate projects to keep your classes as clean as possible.
@andrerav Mapster.Tool is only used to generate Dtos for our own entities that are actually stored separately - and they are partial, too. When using Primitives v6.x, this doesn't happen, as OP stated.
Love what I've seen so far, but I've found that the Mapster.Tool is throwing an error in projects with a unique set of criteria. I've stripped everything away from the project and it seems to boil down to these items being in place:
Given all of these criteria, I get an error message when building the project and trigger a Mapster.Tool rebuild:
Trying different things, some resolve the issue:
I've attached a sample project for this. Thanks!
Mapster.Tool Error.zip