Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
GeneralRe: Config files embedded in exe Pin
Gevik Babakhani22-Nov-02 11:57
Gevik Babakhani22-Nov-02 11:57 
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 
leppie wrote:
What on earth are you trying to do?


Michael wryly smiles as he slowly types out the answer:
Okay...what I am trying to do is build a list of project references to make my code compile correctly from the instance of the managed C# compiler. The references are to system.dll, system.data.dll, and system.xml.dll. (Maybe you begin to see a hint of potential problems here)

Now I can take the obviously simplistic approach which is to build a string array with hard coded directory locations for each dll. Dead | X| But that thought makes me want to stick my finger down my throat. Dead | X| It also locks my code into version 1.0.3705 of the framework. (part of the directory structure name) It would also lock me into either a machine with C:\WINNT or C:\WINDOWS as the system directory name for locating system.dll.

So the obvious next step is to get very generic by having my code say " Where is the assembly for System? " " Where is the assembly for System.XML?" or even " Where is the assembly for system.dll?". 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!!!!!

Eek! | :eek: whew --- so that is the off-the-wall thing I am trying to do. End result is so cool you would not believe it.

Cool | :cool: We take a complex XML file, build a compressed schema of the file, run that through a SchemaToXML transform (our developed transform) that expresses all parts of the XML file as objects, then we do three transforms to create object.cs, reader.cs, and writer.cs. The final step is those three files get compiled into a dll and VOILA --- you now have an object model representation of that complex XML file for locating data, reading data, and updating data. In our case, that complex XML file is a fully externalized set of business rules that control parts of our application code. From a coders' viewpoint, accessing that xml file is no different that doing a "SELECT where TYPE = 'funky'" and getting back a collection of entries from the XML file that matches that type.

I'm writing the wizard that makes that whole build process an automated generation for any XML file fed to it, complete to the compiled DLL. Cool | :cool:

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!!!)


<publicnameexposed> Michael
Thanks for ANY help you can provide!

Condor

_____________________________________________
The world is a dangerous place.
Not because of those that do evil,
    but because of those who look on and do nothing.

GeneralRe: invoking the compiler from my own code Pin
leppie26-Nov-02 9:29
leppie26-Nov-02 9:29 
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 

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.