C# Code Generation

2006-10-19
2013-05-28
  • Scot Becker
    Scot Becker
    2006-10-19

    I've set the CustomTool property and have selected C# (among others) in the ORMGeneratorSettings. all of the files (the intermediate files, DDL files, XSD files, etc.) generate except for the C3 file (or VB, for that matter). The file shows up in the solution explorer but has the yellow warning icon and attempts to open the file are met with "The item 'ORMModel1.cs' does not exist in the project directory. It may have been moved, renamed or deleted." (and indeed, the file is not present on my drive). Plix is installed. Am I missing a step someplace?

     
    • Kevin M. Owen
      Kevin M. Owen
      2006-10-19

      Is a file named 'ORMModel1.ORMCustomToolReport.cs' present in the project?
      If it is, see if there are any error messages in it.

       
    • Scot Becker
      Scot Becker
      2006-10-19

      It's there and has no errors.

      Thanks,
      Scot.

       
    • Kevin M. Owen
      Kevin M. Owen
      2006-10-19

      Try right-clicking on 'ORMModel1.orm' in the Solution Explorer and selecting "Run Custom Tool". Does this cause any errors to appear in the error list ("View" \ "Error List") or in the 'ORMModel1.ORMCustomToolReport.cs' file?

       
    • Scot Becker
      Scot Becker
      2006-10-19

      Running the tool appears to do nothing (there is no hourglass, prompt, or anything like that) and there are no errors.

      Thanks,
      Scot.

       
      • Kevin M. Owen
        Kevin M. Owen
        2006-10-19

        Interesting... Could you send me the .csproj file for that project?

         
    • Scot Becker
      Scot Becker
      2006-10-19

      Sent to the users.sourceforge.net address. Let me know if you don't get it or want me to send it elsewhere.

      Thanks,
      Scot.

       
    • Scot Becker
      Scot Becker
      2006-10-19

      Sigh... my domain is blacklisted from the sourceforge mail server (I use an ISP that used to have open relays or something). Can you e-mail me at my first name (1 t) at orthogonal software.com? I'll send the file in reply. Thanks...

       
      • Kevin M. Owen
        Kevin M. Owen
        2006-10-19

        OK, I received the file and I think I see what the problem is.
        The C# code is generated from the PLiX representation of the generated object model, but I don't see a PLiX file listed in your .csproj file. When you selected C# as one of the outputs you wanted, the ORMCustomTool should have automatically enabled the PLiX output as well, but for whatever reason it may not have. If you open up the "ORMGeneratorSettings" dialog for your ORM model file and select "PLiX" as one of the output formats, your C# file should then generate correctly.

         
        • Scot Becker
          Scot Becker
          2006-10-19

          I don't have plix listed in the generator settings. I know I installed the MSI orignally -- and I did again just today.

          Scot.

           
          • Scot Becker
            Scot Becker
            2006-10-19

            Removed and reinstalled plix. I didn't realize the Plix to CSharp checkbox collapsed under the c# checkbox. Not sure if it was there before but it is now, it is checked, and I have the same problem.

             
    • Scot Becker
      Scot Becker
      2006-10-19

      I noticed that HKEY_LOCAL_MACHINE\SOFTWARE\Neumont\ORM Architect for Visual Studio\Generators\OIALtoPLiX has a blank TransformUri value; could that be the cause?

       
      • Scot Becker
        Scot Becker
        2006-10-19

        I changed this value to C:\Program Files\Common Files\Neumont\ORM\Transforms\OIALtoPLiX.xslt. Now I get a top level checkbox for plix (OAIL to PLiX) but the .plix.xml file has the same icon as (and is not generated like) the cs file.

         
        • Kevin M. Owen
          Kevin M. Owen
          2006-10-19

          Are the other values correct? Specifically, SourceInputFormat should be "OIAL" and ProvidesOutputFormat should be "PLiX".
          You may want to try doing a repair on the NORMA installation (from the "Add or Remove Programs" dialog).

           
          • Scot Becker
            Scot Becker
            2006-10-19

            The other values were correct. I removed NORMA and PliX and reinstalled. After both installs, the TransformUri value is blank. The PliX install was weird: It run a couple of status bars and then nothing. Is that normal? It created the PLiX for Visual Studio dir (with two files) and didn't error or anything, but I guess I expected the typical install wizard?

             
            • Scot Becker
              Scot Becker
              2006-10-19

              that is, two files in the bin dir.

               
    • Scot Becker
      Scot Becker
      2006-10-21

      After setting the registry key above to "C:\Program Files\Common Files\Neumont\ORM\Transforms\OIALtoPLiX.xslt" and trying to generate C# code, I now get errors as below. Am I reading those paths right? Is there some explicit paths to mcurland's stuff?

      -----------------------------

      // Report file generated by ORMCustomTool.
      // Any generation errors will appear as #error lines in this file,
      // followed by the exception message and stack trace.
      #error Exception occurred while executing transform 'OIALtoPLiX'. The existing contents of 'ORMModel1.PLiX.xml' will not be modified.
      // System.Xml.Xsl.XslLoadException
      // XSLT compile error.
      //    at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
      //   at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)
      //   at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)
      //   at System.Xml.Xsl.XslCompiledTransform.CompileToQil(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
      //   at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
      //   at System.Xml.Xsl.XslCompiledTransform.Load(String stylesheetUri, XsltSettings settings, XmlResolver stylesheetResolver)
      //   at Neumont.Tools.ORM.ORMCustomTool.ORMCustomTool.XslORMGenerator.LoadTransform() in C:\Documents and Settings\mcurland\My Documents\Visual Studio 2005\Projects\ORMPackage\XML\ORMCustomTool\XslORMGenerator.cs:line 90
      //   at Neumont.Tools.ORM.ORMCustomTool.ORMCustomTool.XslORMGenerator.EnsureTransform() in C:\Documents and Settings\mcurland\My Documents\Visual Studio 2005\Projects\ORMPackage\XML\ORMCustomTool\XslORMGenerator.cs:line 101
      //   at Neumont.Tools.ORM.ORMCustomTool.ORMCustomTool.XslORMGenerator.GenerateOutput(BuildItem buildItem, Stream outputStream, IDictionary`2 inputFormatStreams, String defaultNamespace) in C:\Documents and Settings\mcurland\My Documents\Visual Studio 2005\Projects\ORMPackage\XML\ORMCustomTool\XslORMGenerator.cs:line 183
      //   at Neumont.Tools.ORM.ORMCustomTool.ORMCustomTool.GenerateCode(String bstrInputFileContents, String wszDefaultNamespace, IVsGeneratorProgress pGenerateProgress, WriteReportItem report) in C:\Documents and Settings\mcurland\My Documents\Visual Studio 2005\Projects\ORMPackage\XML\ORMCustomTool\ORMCustomTool.cs:line 571
      // Information from InnerException
      // System.Xml.Xsl.XslLoadException
      // XSLT compile error.
      //    at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)
      //   at System.Xml.Xsl.Xslt.XsltLoader.Load(Compiler compiler, Object stylesheet, XmlResolver xmlResolver)
      //   at System.Xml.Xsl.Xslt.Compiler.Compile(Object stylesheet, XmlResolver xmlResolver, QilExpression& qil)
      //   at System.Xml.Xsl.XslCompiledTransform.CompileToQil(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
      //   at System.Xml.Xsl.XslCompiledTransform.LoadInternal(Object stylesheet, XsltSettings settings, XmlResolver stylesheetResolver)
      //   at System.Xml.Xsl.XslCompiledTransform.Load(String stylesheetUri, XsltSettings settings, XmlResolver stylesheetResolver)
      //   at Neumont.Tools.ORM.ORMCustomTool.ORMCustomTool.XslORMGenerator.LoadTransform() in C:\Documents and Settings\mcurland\My Documents\Visual Studio 2005\Projects\ORMPackage\XML\ORMCustomTool\XslORMGenerator.cs:line 90
      //   at Neumont.Tools.ORM.ORMCustomTool.ORMCustomTool.XslORMGenerator.EnsureTransform() in C:\Documents and Settings\mcurland\My Documents\Visual Studio 2005\Projects\ORMPackage\XML\ORMCustomTool\XslORMGenerator.cs:line 101
      //   at Neumont.Tools.ORM.ORMCustomTool.ORMCustomTool.XslORMGenerator.GenerateOutput(BuildItem buildItem, Stream outputStream, IDictionary`2 inputFormatStreams, String defaultNamespace) in C:\Documents and Settings\mcurland\My Documents\Visual Studio 2005\Projects\ORMPackage\XML\ORMCustomTool\XslORMGenerator.cs:line 183
      //   at Neumont.Tools.ORM.ORMCustomTool.ORMCustomTool.GenerateCode(String bstrInputFileContents, String wszDefaultNamespace, IVsGeneratorProgress pGenerateProgress, WriteReportItem report) in C:\Documents and Settings\mcurland\My Documents\Visual Studio 2005\Projects\ORMPackage\XML\ORMCustomTool\ORMCustomTool.cs:line 571

       
      • Kevin M. Owen
        Kevin M. Owen
        2006-10-21

        Those paths are just the locations of the source files for ORMCustomTool on the machine where that release was built.
        It looks like for some reason it is failing to compile the OIALtoPLiX.xslt file. If you send me your copy of that file, I can take a look at it and see if I can figure out why that is happening. Alternatively, we should be posting a new release of NORMA by the end of the day on Monday; installing the new version should hopefully also resolve any issues.

         
    • Scot Becker
      Scot Becker
      2006-10-25

      I think it is working with CTP10. I say "think" because I haven't digested all of the code yet but I do have CS files beaneath *.Abstract.PLiX.xml, *.Implementation.PLiX.xml, and *.Support.PLiX.xml. Let me know if I am missing something....

      BTW, I found that to install NORMA CTP10, I had to first install the VS 2005 SDK (to get the DSL tools) and PLiX; the NORMA installer failed otherwise.

      FYI,
      Scot.