yagasoft / DynamicsCrm-CodeGenerator

A Visual Studio extension that allows generating early bound classes for Microsoft Dynamics CRM entities based on a template file.
http://yagasoft.com
GNU General Public License v3.0
11 stars 7 forks source link

VS Plugin not working in .NET Core Libs #6

Open koehler0179 opened 3 years ago

koehler0179 commented 3 years ago

VS Plugin works really great but currently it is not possible to run the Codegenerator in .NET Core Libs. Current workaround: Create a .NET Lib and copy over the generated classes over a post-build action.

yagasoft commented 3 years ago

@koehler0179 Would you please elaborate on the issue with reproduction steps? I need to check it on my system.

yagasoft commented 3 years ago

I created a Core project, and it seems that when generating, the VS T4 engine just hangs for some reason. I will try to investigate further.

If you find any error messages, or anything that could help, please share.

koehler0179 commented 3 years ago

Are you using the Xrm.Tooling lib to connect to crm and the old Xrm SDK Libs? If yes, that is maybe the reason why it is not working in .NET Core Libs. It is not possible to use old Xrm.Tooling and old Xrm SDK Libs in Core projects. Therefore you should use the new Dataverse Client Lib which is build for .NET Core. Change should not be very hard because Microsoft didn´t change the namespaces. But that is just a guess from my side. Maybe it is also something different. If I have time I will try to investigate to figure out why it is not starting.

yagasoft commented 3 years ago

I don't believe that 'connecting' is the issue. It connects fine to CRM but crashes at this line: var content = t4.ProcessTemplate(wszInputFilePath, bstrInputFileContents, cb);

It seems that the Visual Studio T4 engine has an issue with this type of projects. I will investigate further and share any findings.

yagasoft commented 3 years ago

A quick look and it seems that I might need to migrate to a newer template of Visual Studio Extensions. I also have to check for VS 2017 compatibility, because from what I found, .NET Core support for T4 was added to VS in v16.6 only.

I believe this will take some time, to even go more in-depth and find an alternative if an issue pops up in VS 2017.