Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
Generalinvoking the compiler from my own code Pin
LongRange.Shooter22-Nov-02 9:33
LongRange.Shooter22-Nov-02 9:33 
GeneralRe: invoking the compiler from my own code Pin
leppie22-Nov-02 12:20
leppie22-Nov-02 12:20 
GeneralRe: invoking the compiler from my own code Pin
LongRange.Shooter25-Nov-02 3:37
LongRange.Shooter25-Nov-02 3:37 
GeneralRe: invoking the compiler from my own code Pin
leppie23-Nov-02 2:31
leppie23-Nov-02 2:31 
GeneralRe: invoking the compiler from my own code Pin
LongRange.Shooter26-Nov-02 4:56
LongRange.Shooter26-Nov-02 4:56 
GeneralRe: invoking the compiler from my own code Pin
leppie26-Nov-02 6:11
leppie26-Nov-02 6:11 
GeneralRe: invoking the compiler from my own code Pin
LongRange.Shooter26-Nov-02 8:49
LongRange.Shooter26-Nov-02 8:49 
GeneralRe: invoking the compiler from my own code Pin
leppie26-Nov-02 9:29
leppie26-Nov-02 9:29 
theRealCondor wrote:
That is as long as I can systematically get the path name of the three system DLL's. I also tried exploring the File object to see if it exposed a FindFile method but that did not pan out either. I keep coming back to reflection, since it is dealing with known DLL's and it should be able to provide me with the assembly information that includes pathname. (After all, the assembly info when you Create Reference includes the full pathname!!!)

I would suggest using CodeDom 's compilers instead. Like this:

CompilerParameters pars = new CompilerParameters();
pars.ReferencedAssemblies.Add("System.dll");
pars.ReferencedAssemblies.Add("System.Data.dll");
pars.ReferencedAssemblies.Add("System.Xml.dll");
CompilerResults res = new Microsoft.CSharp.CSharpCodeProvider().CreateCompiler().CompileAssemblyFromFileBatch(
   pars, new String[]{"one.cs","two.cs","three.cs"});


Now you have a ReferencedAssemblies collection, also I STILL dont understand why you wanna do this. AFAIK your assembly can ONLY use the framework version its been built on or newer (why would you ever want to use something older if you have something newer? Answer: dont install newer framework then!).

theRealCondor wrote:
That way if my wizard runs on a machine with 1.0.3705 it will find the current version of system.dll compile the code correctly, AND when someone runs my wizard on a machine with 1.1.0000 then it too will find the current version of system.dll and compile correctly as well!!!!!

As above, this will be (AFAIK) the default behaviour. I have used my above method without having to specify a path to it....with NO problems.

Hope this helps Smile | :)

DBHelper - SQL Stored Procedure Wrapper & Typed DataSet Generator for .NET popularity better now, thank you Smile | :)
GeneralRe: invoking the compiler from my own code Pin
LongRange.Shooter26-Nov-02 10:07
LongRange.Shooter26-Nov-02 10:07 
GeneralRe: invoking the compiler from my own code Pin
leppie26-Nov-02 12:39
leppie26-Nov-02 12:39 
GeneralRe: invoking the compiler from my own code Pin
LongRange.Shooter26-Nov-02 10:18
LongRange.Shooter26-Nov-02 10:18 
GeneralReplace colour using GDI+ Pin
BigAndy22-Nov-02 4:56
BigAndy22-Nov-02 4:56 
GeneralRe: Replace colour using GDI+ Pin
Joshua Nussbaum22-Nov-02 10:45
Joshua Nussbaum22-Nov-02 10:45 
QuestionSyntax Highlightning with C# and RichTextBox? Pin
Joe_22-Nov-02 1:19
Joe_22-Nov-02 1:19 
AnswerRe: Syntax Highlightning with C# and RichTextBox? Pin
perlmunger25-Nov-02 19:24
perlmunger25-Nov-02 19:24 
GeneralImpersonate remote caller Pin
solidstore21-Nov-02 23:14
solidstore21-Nov-02 23:14 
GeneralFinding the baseline of a Font Pin
Oppy21-Nov-02 12:56
Oppy21-Nov-02 12:56 
GeneralEncasing other windows in a C# winform Pin
Anonymous21-Nov-02 11:11
Anonymous21-Nov-02 11:11 
GeneralProblem with AutoScrollPosition Pin
Marc Clifton21-Nov-02 10:37
mvaMarc Clifton21-Nov-02 10:37 
GeneralRe: Problem with AutoScrollPosition Pin
leppie22-Nov-02 6:35
leppie22-Nov-02 6:35 
Generalhelp with executing a transform! Pin
LongRange.Shooter21-Nov-02 9:36
LongRange.Shooter21-Nov-02 9:36 
GeneralRe: help with executing a transform! Pin
LongRange.Shooter22-Nov-02 9:35
LongRange.Shooter22-Nov-02 9:35 
QuestionCopying pointer to pointer? Pin
Zombies with Coffee, LLC21-Nov-02 9:02
professionalZombies with Coffee, LLC21-Nov-02 9:02 
AnswerRe: Copying pointer to pointer? Pin
leppie21-Nov-02 9:33
leppie21-Nov-02 9:33 
GeneralRe: Copying pointer to pointer? Pin
Zombies with Coffee, LLC21-Nov-02 9:45
professionalZombies with Coffee, LLC21-Nov-02 9:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.