Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Fix NuGet package OnBuildGenerator #166

Open
MisinformedDNA opened this issue Feb 15, 2021 · 4 comments
Open

Fix NuGet package OnBuildGenerator #166

MisinformedDNA opened this issue Feb 15, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@MisinformedDNA
Copy link

Mapping Generator Version
[Current]

Mapping Generator distribution
NugetPackage

IDE type and version
Visual Studio 2019 16.8

Describe the incorrect behavior
The MappingGenerator.OnBuildGenerator on NuGet is broken. Running the code from this test case, results in 3 errors, such as

The type or namespace name 'OnBuildGenerator' does not exist in the namespace 'MappingGenerator' (are you missing an assembly reference?)

Describe the expected behavior
No compilation issues.

Screenshots
image

@MisinformedDNA MisinformedDNA added the bug Something isn't working label Feb 15, 2021
@cezarypiatek
Copy link
Owner

Hi,
The MappingGenerator.OnBuildGenerator assembly is not added to project dependencies. You need to copy the attribute definition directly to your source code. Please follow this guideline to set up OnBuildGenerator correctly https://cezarypiatek.github.io/post/generate-mappings-on-build/#generate-mapping-code-on-build

Please let me know if you still have any troubles.

Have a nice day,
Cezary

@MisinformedDNA
Copy link
Author

@cezarypiatek Thanks for the response. I get this error when adding SmartCodeGenerator.Engine:

MSB3073 The command "C:\Users\50587.nuget\packages\smartcodegenerator.engine\1.4.23\build/../tools/SmartCodeGenerator.Engine.exe -p C:\Users\50587\source\repos\MappingGeneratorPoC\MappingGeneratorPoC\MappingGeneratorPoC.csproj -o C:\Users\50587\source\repos\MappingGeneratorPoC\MappingGeneratorPoC\obj\Debug\netcoreapp3.1\ -g C:\Users\50587.nuget\packages\mappinggenerator.onbuildgenerator\1.22.1.18\build/../tools/MappingGenerator.OnBuildGenerator.dll" exited with code -532462766. MappingGeneratorPoC C:\Users\50587.nuget\packages\smartcodegenerator.engine\1.4.23\build\SmartCodeGenerator.Engine.targets 11

@cezarypiatek
Copy link
Owner

Can you attach a sample solution that reproduces this problem?

@MisinformedDNA
Copy link
Author

MappingPoC.zip

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants