Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project file corrupted after import #402

Closed
stvtm opened this issue Apr 11, 2023 · 5 comments
Closed

Project file corrupted after import #402

stvtm opened this issue Apr 11, 2023 · 5 comments

Comments

@stvtm
Copy link

stvtm commented Apr 11, 2023

Tool and Version
Earlyboundgenerator 1.2022.9.22
xrmtoolbox 1.2023.2.64

Describe the bug
After generating the entities in a folder in a class library, the project file of that library is corrupt. The cause is that it just adds a new element without checking if the previous line is closed with<compile/> vs <compile></compile> . This happens when a typed dataset is present in the library.

Example: in the below example the generated class will be inserted on the second line, instead of after the </compile> element:

Before:


<ItemGroup>
    <Compile Include="DAL\khkAccountOpleidingAcademiejaar\dsKhkAccountOpleidingAcademiejaar.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>dsKhkAccountOpleidingAcademiejaar.xsd</DependentUpon>
    </Compile>

After


<ItemGroup>
    <Compile Include="DAL\khkAccountOpleidingAcademiejaar\dsKhkAccountOpleidingAcademiejaar.Designer.cs">
<Compile Include="XRM365\Entities\Account.cs" /> **=>WRONG**
 <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>dsKhkAccountOpleidingAcademiejaar.xsd</DependentUpon>
    </Compile>

IT should be:


<ItemGroup>
    <Compile Include="DAL\khkAccountOpleidingAcademiejaar\dsKhkAccountOpleidingAcademiejaar.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>dsKhkAccountOpleidingAcademiejaar.xsd</DependentUpon>
    </Compile>
<Compile Include="XRM365\Entities\Account.cs" />

To Reproduce
Steps to reproduce the behavior:

  1. Add a typed dataset to a c# class library
  2. Generate the entities

Expected behavior
The project file should look like this (compile element below element of the previous dataset:

<ItemGroup>
    <Compile Include="DAL\khkAccountOpleidingAcademiejaar\dsKhkAccountOpleidingAcademiejaar.Designer.cs">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>dsKhkAccountOpleidingAcademiejaar.xsd</DependentUpon>
    </Compile>
<Compile Include="XRM365\Entities\Account.cs" />
@daryllabar
Copy link
Owner

This bug has been here for years, thanks for reporting! Unfortunately I'm no longer maintaining V1 of the Early Bound Generator and this bug exists in V2 as well, but I'll look to fix it the next version of V2.

@daryllabar
Copy link
Owner

You can see if this fixes your problem. You'll need to replace the DLaB.CrmSvcUtilExtensions dll in your XTB plugins DLaB.EarlyBoundGenerator

DLaB.CrmSvcUtilExtensions.zip

@stvtm
Copy link
Author

stvtm commented Apr 12, 2023

Hello Daryl
Thanks for your super quick reply!

Unfortunately it still gives exactly the same error.

I replaced the dll in the xrmtoolbox storage folder (i got that path via xrmtoolbox -> configuration -> settings -> paths : "open xrm toolbox storage folder". And then in the plugins oflder under DLaB.Earlyboundgenerator:

C:\Users...\AppData\Roaming\MscrmTools\XrmToolBox\Plugins\DLaB.EarlyBoundGenerator

And then started the xrmtoolbox exe and generated the entities. But still the sub element within the exact same<compile></compile> element, at the same line number.

However, it's just a very small nuisance in an otherwise excellent and helpful tool, so don't feel obligated to solve this on the spot. I know how to fix it after generating it, so it still works for me with just one extra step. If it gets solved someday: great. Otherwise: no problem, I can still generate my entities.

@daryllabar
Copy link
Owner

Can you share your project file itself then? You can give to me on Twitter or LinkedIn if you don't want to share publicly

@daryllabar
Copy link
Owner

I'm assuming this has been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants