473,322 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

is there a way to get an assembly to parse its own source code at runtime ?

We have an old system that uses Scheme as its scripting language, that
many developers need to use, but 99% of our people know C# & .NET, not
Scheme. This system is not going away anytime soon. Some of us had the
bright idea to make a system to allow you to write the scripts in C#
(using VS.NET, with Intellisense, debugging, etc., and being able to
run the scripts from VS.NET), and then have it generate Scheme code
from its own source code. We can do it the old "one-two" way... for
every line of C# code you have one line of scheme generating code.
However this wouldn't work too well for SELECT CASE or IF/THEN/ELSE
blocks for the logic that is not running. So there would have to be a
completely seperate code base that the Scheme generator uses. Which is
hokey, since then you have to code your app twice. I was thinking maybe
there is a way to get an assembly to parse its own source code at
runtime? We could just write another app that works on the blah.cs
files, but the other way just sounds more fun.

Nov 22 '05 #1
1 1190
I think the compile on the fly option will work for me... Has anyone
done this? If you have a text file "mycode.txt" with c# code in it, how
would you compile it from within your running app and then execute that
code (say, a method of a stateless object - myobject.mymethod) ?

Mad Scientist Jr wrote:
We have an old system that uses Scheme as its scripting language, that many developers need to use, but 99% of our people know C# & .NET, not Scheme. This system is not going away anytime soon. Some of us had the bright idea to make a system to allow you to write the scripts in C#
(using VS.NET, with Intellisense, debugging, etc., and being able to
run the scripts from VS.NET), and then have it generate Scheme code
from its own source code. We can do it the old "one-two" way... for
every line of C# code you have one line of scheme generating code.
However this wouldn't work too well for SELECT CASE or IF/THEN/ELSE
blocks for the logic that is not running. So there would have to be a
completely seperate code base that the Scheme generator uses. Which is hokey, since then you have to code your app twice. I was thinking maybe there is a way to get an assembly to parse its own source code at
runtime? We could just write another app that works on the blah.cs
files, but the other way just sounds more fun.


Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Carlos G Benevides | last post by:
I have a ASP.Net web application that has two assemblies that run under com+. Under Windows 2000 the two assemblies are added to com+ automatically when instantiated from the web site. For this...
1
by: Mad Scientist Jr | last post by:
We have an old system that uses Scheme as its scripting language, that many developers need to use, but 99% of our people know C# & .NET, not Scheme. This system is not going away anytime soon....
2
by: Carl Mercier | last post by:
Hi! I have 2 different applications/assembly. The first one creates an object and serializes it to a textfile on disk. The second one has the the exact same class (copied/pasted). It reads...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
1
by: Robert | last post by:
I have a server where the main web application (root) is now migrated to 2.0. It's web.config has a line where it adds the system.data.oracleclient in the configuration and assembiles section. ...
2
by: john | last post by:
Maybe I haven't had that "a-ha" moment yet, but I think the new approach to web projects is a step in the wrong direction. My main beef is that control over the assembly generation process has...
2
by: Luis Arvayo | last post by:
I am compiling and executing c# code at runtime and I need to define in CompilerParameters.ReferencedAssemblies one of my own assemblies together with the standard System.dll u others. Example:...
4
by: =?Utf-8?B?SmFu?= | last post by:
I have a .NET 2.0 application divided in two assemblies; the exe and a dll. The application generates a plugin-dll which is then loaded in a separate AppDomain (along with a second instance of my...
2
by: Chen Zhuo | last post by:
Hi all experts, We are having a problem with the exact time when a C# dll gets loaded in managed C++. The scenario is like: In managed.cpp: #using MyCSharp.dll
3
by: cristalink | last post by:
Hi, I have a C++/CLI DLL which I marked with in a cpp file. Is there a standard tool from Microsoft that takes a .DLL file and displays all the .NET attributes of the assembly? Thanks, ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.