37 questions
3
votes
2
answers
4k
views
System.PlatformNotSupportedException Compiling C# code at runtime .NET Core
Trying to compile simple C# code at runtime on .NET Core but have this error:
System.PlatformNotSupportedException: 'Operation is not supported on
this platform.'
on this line:
CompilerResults ...
1
vote
1
answer
136
views
System.CodeDom.Compiler Interface IScript not defined
I used the following answers to test compile code:
https://stackoverflow.com/a/21382083/9942758
https://stackoverflow.com/a/14711110/9942758
Here is my code:
Public Interface IScript
...
0
votes
0
answers
882
views
Error code:CS2021 (File name 'C:" /debug- /optimize+ C:\svo2trpm.0.cs' is too long or invalid) While creating assembly using CODEDOM
I am trying to create an assembly using CODEDOM. The assembly am creating will contain a POCO class and the properties that this class will carry will be coming from Database. Everything is going fine ...
1
vote
1
answer
394
views
Can an assembly generated using CodeDomProvider be deallocated?
I want to code an app that allows the user to define GUI driven code snippets.
In this context, I aim to send these snippet definitions to a service which will be able to compile and run it (code dom,...
0
votes
0
answers
176
views
How to get static resources from assembly's referenced assembly
I got an assembly, created by System.CodeDomCompiler at runtime. The compiled assembly use a referenced assembly. Further i declare CodeDomAssembly as my compiled assembly at runtime, and RefAssembly ...
1
vote
1
answer
2k
views
Missing Added Reference When Using CodeDom Compiler
I've found similar questions to this but not managed to find something which specifically addresses my problem yet.
I have some code which edits an Excel workbook via System.CodeDom.Compiler. This is ...
0
votes
1
answer
391
views
Console.WriteLine text from CodeDomProvider
I'm trying to use CodeDomProvider to make a C# compiler.
I managed to get the errors but i can't get the output.
This is what i have so far:
public List<string> Errors(CompilerResults ...
0
votes
1
answer
305
views
Compile a non-commandline application using CodeDomProvider?
I've written this simple function to automate the compilation of a single exe assembly with an embedded resource:
Public Shared Function CompileAssembly(ByVal codeProvider As CodeDomProvider,
...
22
votes
1
answer
914
views
How can I programmatically do method overload resolution in C#?
When the C# compiler interprets a method invocation it must use (static) argument types to determine which overload is actually being invoked. I want to be able to do this programmatically.
If I ...
2
votes
0
answers
517
views
Windows cannot open this program because the license enforcement system has been tampered with or become corrupted
I have a problem with my website. I recently upgraded the website from Framework 2.0 to 4.0. Now when entering an URL on the website. I receive this error message
See screenshot of error here:
http://...
0
votes
1
answer
594
views
Is it possible to get a stream for an assembly generated in memory using CodeDOM?
In some of my tests I need to generate some assemblies and then "decompile" them using ICSharpCode.Decompiler which uses Mono.Cecil to inspect assemblies.
For performance reasons I'd like to generate ...
1
vote
1
answer
183
views
how to prevent to open in console my dynamically generated exe
I am working in c# 4.0, i want to generate an executable file dynamically, so i used Code Dome, but when i executes it open in console and after then my form displays, i want to generate winform ...
1
vote
1
answer
499
views
Call a 'host' callback from a 'compiled assembly from source'
I'm compiling code on-the-fly using System.CodeDom.Compiler. Everything inside the compiled source works well, whatever I'm putting inside this source. I know how to call my functions:
o = results....
0
votes
1
answer
101
views
Refer custom class in the Auto generated class?
I've two classes that I am trying to generate code using CodeDom. First class (StudentModel), pretty straight forward, I am able to generate using CodeDom.
In the second class, i.e. Student class, I ...
0
votes
1
answer
772
views
CodeDom Generate Unsafe Code OR Alternate Compilation Alternatives
I just got done developing a fairly large project using CodeDom. Well, almost done - exept for one small issue - One of the classes in my project requires the /unsafe tag. I have read that CodeDom ...
1
vote
2
answers
679
views
C# Compiling User Supplied Code And Using
What I'm trying to do is allow a user to write a method in a textbox and have my code call that method. This will eventually be used in a demo applet for optimization given a goal function.
So I've ...
0
votes
1
answer
1k
views
Error in adding assembly from dll in C# codedom compiler parameter
I am working on a c# codedom project which provides users to dynamically compile the c# code.
I am getting error when adding assembly dll of wpf (it is working fine for winforms). It is saying that "...
5
votes
1
answer
1k
views
Which .NET Programming Languages Have a CodeDom Provider?
Aside from C#, VB.NET, C++ (Managed and C++/CLI), and F#, which .NET programming languages have their own CodeDom provider?
9
votes
3
answers
19k
views
CompilerParameters.ReferencedAssemblies -- Add reference to System.Web.UI.WebControls
I am compiling classes at run-time using the CodeDomProvider class. This works fine for classes only using the System namespace:
using System;
public class Test
{
public String HelloWorld()
{...