Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Using the CodeDOM
Subject:   Doesn't work!
Date:   2004-02-12 15:58:37
From:   dipin
Response to: Doesn't work!

Is it possible for you to make the complete source code available?
Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • 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