| Sign In/My Account | View Cart |
| 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? | ||
Showing messages 1 through 1 of 1.
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