Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Using the CodeDOM
Subject:   Doesn't work!
Date:   2003-02-12 18:52:22
From:   neh123us@yahoo.com
Response to: Doesn't work!

I am sorry that you had difficulty getting the sample code to work. In the future I will try to make it easier to get the complete source code.
Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Doesn't work!
    2004-02-12 15:58:37  dipin [View]

    Is it possible for you to make the complete source code available?
    • Doesn't work!
      2004-12-10 07:16:29  PaulHayman [View]

      Changes Required..

      1) Change the following Line in CodeVariableDeclarationStatement method :

      CodePrimitiveExpression[] cpe = new CodePrimitiveExpression[Characters.Length];

      to

      CodePrimitiveExpression[] cpe = new CodePrimitiveExpression[Characters.Length-1];

      2) Use these namespaces in your class:

      using System;
      using System.IO;
      using System.CodeDom;
      using System.Text;
      using System.CodeDom.Compiler;
      using Microsoft.CSharp;
      using Microsoft.VisualBasic;


      3) Move the CurrentNamespace variable outside the CodeComProvider so it is in scope for the GenerateCode method.

      4) In the CSharpCode property, change the return statement so that it returns GenerateCode() rather than GeneratorCode()

      I could post my working solution to an email address if you wish.

      Paul