Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Using the CodeDOM
Subject:   Doesn't work!
Date:   2004-12-10 07:16:29
From:   PaulHayman
Response to: Doesn't work!

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