in

The ORM Foundation

Get the facts!

Error on NORMA for VS2010 when adding new ORM Generator transform

Last post 07-08-2011 4:57 by lozdown. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-07-2011 7:48

    • lozdown
    • Top 75 Contributor
      Male
    • Joined on 06-06-2011
    • Rugby
    • Posts 7

    Error on NORMA for VS2010 when adding new ORM Generator transform

     I have been following the thread How to create value type group which is close to what I want to do. I followed the instructions there and added the following registry keys slightly changed for NORMA on VS2010.

    [HKEY_LOCAL_MACHINE\SOFTWARE\ORM Solutions\Natural ORM Architect for Visual Studio 2010\Generators\AuditColumns]
    "Type"="XSLT"
    "OfficialName"="AuditColumns"
    "DisplayName"="Audit Columns"
    "DisplayDescription"="Adds audit columns to all tables"
    "SourceInputFormat"="DCIL"
    "ProvidesOutputFormat"="DCIL"
    "TransformUri"="C:\\Program Files\\Common Files\\Neumont\\DIL\\Transforms\\AddAuditColumns.xslt"

     Then

    • Opened VS2010
    • Opened my project
    • Opened properties for the .ORM  file
    • Selected ORMGeneratorSettings
      • Dialog displays OK with new ORMGenerator Audit Columns
      • Selected Audit Columns
      • Saved
    • Then reselect ORMGeneratorSettings
      • Get error (see screen grab) 
      • Select Ignore
      • Get another error

    (I'm having trouble putting in a graphic)
    so first line error text is 'at ORMGeneratorSelectionControl..ctor(ProjectItem projectItem, IsServiceProvider serviceProvider) c:\documents and Settings\MCurland\My Documents\Visual Studio 2005\Projects\ORMPacakge\Tools\ORMCustomTool\UI\ORMGenertorSelectionControl.cs(211)...'

    Hope that is useful!

    Thanks for any support on this

    Regards

    Laurie


  • 07-07-2011 14:45 In reply to

    Re: Error on NORMA for VS2010 when adding new ORM Generator transform

    Hi Laurie,

    I'm not seeing this assert (which is benign and should be ignorable), but I am seeing some other issues changing format modifiers in VS2010. VS2010 fully deprecated the Microsoft.Build.Engine namespace, so the code had to be fully and non-trivially rewritten for the Microsoft.Build.Construction namespace. It seems that the new API is having a difficult time removing items, so I'm getting duplicate <ORMGenerator> tags in the project file with corresponding unpredictable behavior. For example, after opening the dialog and adding the 'AddAuditColumns' extension, I'm seeing the following in the project file:

        <None Include="ORMModel1.DCIL.xml">
          <AutoGen>True</AutoGen>
          <DependentUpon>ORMModel1.orm</DependentUpon>
          <ORMGenerator>ConceptualDBtoDCL</ORMGenerator>
          <ORMGenerator>ConceptualDBtoDCL AddAuditColumns</ORMGenerator>
          <ORMGenerator>ConceptualDBtoDCL AddAuditColumns</ORMGenerator>
          <ORMGenerator>ConceptualDBtoDCL AddAuditColumns</ORMGenerator>
        </None>

    instead of the desired setting, with a single ORMGenerator tag with the primary generator listed first and the format modifiers trailing:

        <None Include="ORMModel1.DCIL.xml">
          <AutoGen>True</AutoGen>
          <DependentUpon>ORMModel1.orm</DependentUpon>
          <ORMGenerator>ConceptualDBtoDCL AddAuditColumns</ORMGenerator>
        </None>

    It will take me some time to debug this (I won't have a window this week), but in the meantime you can hand repair the .csproj file as follows:

    1. Select the project node in the Solution Explorer window
    2. Open the context menu and choose 'Unload Project'. You will now see 'ProjectName (Unavailable)'
    3. Open the context menu again and choose 'Edit Project'
    4. Search for ConceptualDBtoDCL and clean up extra ORMGenerator items
    5. Save and close the project file
    6. Right click the project node in Solution Explorer
    7. Choose 'Reload Project'
    8. Select the corresponding .orm file in Solution Explorer
    9. Right click and choose 'Run Custom Tool'

    Sorry about the problem. I don't install format modifiers with the main program right now, and clearly didn't cover the edit scenario (add the primary/save changes/close, reopen/add modifier/save changes/close) when I was testing the VS2010 custom tool.

    I've attached an installer for this sample extension as well (covers VS2005/08/10 and 64/32).

    -Matt

  • 07-08-2011 4:57 In reply to

    • lozdown
    • Top 75 Contributor
      Male
    • Joined on 06-06-2011
    • Rugby
    • Posts 7

    Re: Error on NORMA for VS2010 when adding new ORM Generator transform

     Hi Matt,

    I really appreciate your quick reply. I've implemented the changes you list and now all is working well now (and  explained the mystery duplicate project components I was seeing in the VS2010 project tree).

    Thanks very much, I shall now look at how to use custom properties to add detail to the generated SQL. I am very interested to understand how far I can use NORMA to generate a well designed combined relational/XML implementation in SQLServer. Tally Ho!

    Laurie

Page 1 of 1 (3 items)
© 2008-2014 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service