.NET class that provides access to the C# compiler for compiling code.
0
votes
1answer
24 views
CSharpCodeProvider does not see the Stack<T> class under System.Collections.Generic
I'm building a pseudocode translator and compiler.
It translates the pseudocode to code by performing several string operations, then it uses the CSharpCodeProvider class to compile it, and finally it ...
6
votes
1answer
81 views
Weird Assembly.Load error trying to load assembly compiled with C# code provider
I'm trying to compile an assembly from my code with C# code provider.
When I access the compiled assembly with compilerResult.CompiledAssembly, everything works. However, when I instead do ...
-4
votes
1answer
73 views
How to call this code in class?
I am working on some text highlighting and I want to link this code
*specifically the rtb witch is the richtextbox that been declared in class of Form not in toolbox:
mainForm:
public class DTextE ...
0
votes
4answers
99 views
Member is inaccessible due to its protection level error
connected within this topic:
How to connect string from my class to form
im trying to do solutions related to their answers (specifically answer of sir Jeremy) but this error keeps on appearing
...
1
vote
0answers
55 views
Generate res file in C# during execution
I'm writing a little tool to create "iconholder-apps" (applications with no/small code part - infobox only).
The application should hold multiple icons (win32 res Resource) und should be created from ...
0
votes
0answers
41 views
Create instance of Class using Interface name [duplicate]
Possible Duplicate:
Implementations of interface through Reflection
I'm doing some on-the-fly code compiling and can't get it to work...
var compilationResult = ...
1
vote
0answers
57 views
CSharpCodeProvider and obfuscation
I would like to create a DLL dynamically in my Web Application which can generate a unique class (specifically a unique variable inside which is unique to this download) and then can be downloaded by ...
1
vote
1answer
175 views
Slow dynamic compilation with CSharpCodeProvider
I was trying to compare dynamic compilation with standard compilcation. And dynamic compilation seems to be a lot slower. 1400% slower according to my benchmark.
Here is the method that generates a ...
1
vote
3answers
164 views
Releasing from memory code generated by CSharpCodeProvider
I used CSharpCodeProvider to compile and generate a new temp (code) namespace in the memory for temporary use only .
This namespace should be deleted from the memory to give space and release all ...
1
vote
2answers
68 views
How do you access objects in the currect application when invoking code compiled at runtime?
My current project is an application that allows you to write code in C# and then execute it using CSharpCodeProvider. It works fine at this point as long as the code is a complete application in ...
1
vote
1answer
275 views
LINQ-related error when using simple CSharpCodeProvider in ASP.NET
I've created a very simple custom compiler:
public class SimpleCompiler : CSharpCodeProvider
{
public SimpleCompiler() : base()
{
File.AppendText("d:\foo.txt","bar");
}
}
In my ...
0
votes
1answer
199 views
CSharpCodeProvider set and verify .NET profile version
I'm using mono for an embedded scripting environment in my application. For the compilation of the scripts I use Microsoft.CSharp.CSharpCodeProvider. Now I require some 4.0 or 4.5 Functionality like ...
1
vote
2answers
138 views
CSharpProvider runtime compilation failing to find a DLL
I am compiling a DLL at runtime using CSharpCodeProvider. My code runs fine on some machines but on otherse it fails with the following error:
error CS0006: Metadata file 'EntityFramework.dll' ...
0
votes
0answers
129 views
Non-Static variables scripting in runtime c#
I'm creating some scripts and running them in runtime, but I'm compiling them only once(unless the code changes) to avoid "memory leak", since everytime I compile a script it take X Kbs from the ...
0
votes
0answers
83 views
How to add a reference to windows script host object when compiling a file on the fly?
please is anyone can help me figure this out. I want to use IWshRuntimeLibrary library to create shortcut icon, i know how to use it within the VS IDE, just add it as reference. My problem is im ...
0
votes
2answers
505 views
How can i extract a file from an embedded resource and save it to Disk?
I'm trying to compile the code below using CSharpCodeProvider, the file is successfully compiled but when i click on the generated exe, i get an error (Windows is searching for a solution to this ...
2
votes
2answers
332 views
How to add reference to Outlook VSTO in a dynamic CSharpCodeProvider script
I am trying to use an xml file to determine which outlook properties be should be included in a workflow executed via VSTO addin code.
Example
The xml might state that the Subject of the current ...
3
votes
1answer
164 views
Outputting C# aliases (int, etc) instead of CLR types (Int32, etc) using CodeDom / CSharpCodeProvider
When generating C# code using CodeDom / CSharpCodeProvider, is it possible to force the output to use C# aliases instead of CLR types where possible?
I am currently parsing the resulting C# code and ...
1
vote
4answers
3k views
How do I programmatically create a windows form?
I have a unique c# source file named source.cs that i compile using CSharpCodeProvider from a builder to get an executable.
I would put an option on the builder whether to display the About form on ...
0
votes
1answer
288 views
Compile ascx files into DLL at runtime
In our ASP.NET application we allow other developers to write asp.net code and we compile their code into in-memory dll.
As part of this we would like to be able to compile ASCX controls into DLL at ...
2
votes
1answer
182 views
Scripts compiled at runtime fail to invoke method with optional arguments
We've added a feature for our users to write C# scripts for the application to execute, which are compiled and run at runtime. The scripts may access an API we've exposed, and they're compiled/run by ...
-2
votes
1answer
75 views
I can't display my array that I have populated through form1Load. Will run without errors but wont run [closed]
public partial class Form1 : Form
{
DateTime[] birth = new DateTime[20];
Person[] People = new Person[20];
public Form1()
{
InitializeComponent();
}
private ...
2
votes
1answer
471 views
Dll refferencing in CSharpCodeProvider only works when it's set to .NET 2.0?
When I set my CSharpCodeProvider class to use .NET 3.5 it errors trying to load certain referenced DLLs:
Line number 0, Error Number: CS0006, 'Metadata file 'System.Linq.dll' could not be found;
Line ...
2
votes
1answer
902 views
How can we add embedded resources to a file which is compiled from a source file at run-time
I'm writing a small application which works at compiling a file from a source (.cs) code file using a function:
public static bool CompileExecutable(String sourceName)
{
//Source file that you ...
3
votes
2answers
657 views
How to assign a custom icon for an application which is compiled from source file?
In my program, I am using the CSharpCodeProvider in order to compile another application from a source file, the code i'am using is the below :
public static bool CompileExecutable(String sourceName)
...
-1
votes
1answer
324 views
CsharpCodeProvider memory leak
Someone helped me to run some codes in runtime using a timer, but after a while I saw that it is just using memory and not releasing it.
I hear something about AppDomain, but I didn't figure out ...
0
votes
1answer
1k views
Using CSharpCodeProvider with .net 4.5 beta
I recently installed the Visual Studio 11 Beta, and I'm trying to update an existing 4.0 project to use 4.5. In the program it compiles some dynamically generated code using CSharpCodeProvider.
/// ...
0
votes
3answers
194 views
how to solve OutOfMemoryException in c#
I am working on image processing project,In my application i am processing one by one images from folder(i am processing images in a while loop), folder contains more than 1000 images.i am using the ...
3
votes
1answer
204 views
CSharpCodeProvider after Obfuscator
I'm using a Scripting system that compile at runtime, it is working good, but when I use some code obfuscator to hide my codes from "bad guys" the scripting stop to work, it returns an error:
...
1
vote
1answer
154 views
Compiling Partial Classes with CSharpCodeProvider
I have a code template which builds files in a project's folder, and uses the properties defined in the partial classes to determine which properties still need to be implemented. As an example:
...