602 questions
0
votes
0
answers
28
views
CodeDOm and jagged array
I have a jagged array created from a XSD.
The type is:
object[][][] myobject;
Using CodeDom, I want to create some functions and one returns an instance of this object, something like:
object[][] ...
0
votes
1
answer
704
views
Deserialization from CodeDOM format is not supported in .NET Core applications. [XAF Winforms]
I recently upgraded my .Net Framework XAF Winforms application.Net8 with 24.1.3
As follows
public static void DoPrintReport(DevExpress.ExpressApp.View view, IReportDataV2 reportData, ...
0
votes
0
answers
49
views
Get namespace for referenced types using CodeDOM
I have some code that creates a DOM from my schema:
XmlSchemaImporter importer = new XmlSchemaImporter(new XmlSchemas { schema });
CodeNamespace code = new CodeNamespace(targetNamespace);
...
1
vote
1
answer
192
views
Get type or namespace not found CodeDom
I'v been facing this problem for hours now.
I'm playing a little bit with codedom but i get : a type or namespace Threading not found.
My compilator code is this one:
using Microsoft.CSharp;
using ...
0
votes
0
answers
871
views
Operation is not supported c#
im using codedom library to compile some codes in string format.
i have to use this library in a .net core project.
first i made a project with .net framework(because codedom works with .net framework)...
0
votes
2
answers
798
views
Force program to use the dll from the %temp% folder
I want to force the compiled program to use the dll from the %temp% folder.
However, if I do like that
compars.EmbeddedResources.Add(Path.GetTempPath() + "\\Newtonsoft.Json.dll");
compars....
2
votes
1
answer
361
views
C# GenerateCodeFromCompileUnit is Generating Code with Special Characters [Microsoft.CSharp.CSharpCodeProvider]
I am using GenerateCodeFromCompileUnit and IndentedTextWriter to Generate Code from C# Source File. Doing this I am able to Generate a .cs file. But I am seeing a special character @ is inserted ...
0
votes
1
answer
157
views
Reference Embedded Resource from Codedom Compiled Exe
I am using CodeDom Compiler and Microsoft.CSharp, I am trying to embed a resource and call it. The reason I don't try to call properties is because I always get an error saying Properties does not ...
1
vote
0
answers
105
views
Measure percentage of method execution when using CodeDOM
I am using CodeDOM in order to execute the method (written by the user). I compile source code into a binary assembly and then execute the method with the appropriate parameters. It works fine, ...
0
votes
1
answer
42
views
event firing from codedom generated dll - how to join an event of a runtime generated dll form main exe application
I have some user inputs of type string[] for calculations. I want to compile them and get faster computation than any other method.
User input strings:
double _1 = 2 + 2;
double _2 = _1 + Get_Variable(...
0
votes
1
answer
262
views
Create Event handles dynamically using variable as the actions
I'm try to improve our dynamic reporting system. I would like to add event handle to the object I've dynamically created on the form. One of the functions of this would be to populate a listbox from ...
0
votes
2
answers
141
views
How to add forloop in If-Else condition in c#?[CODEDOM]
How to execute the following code in Codedom:
if(statement)
{
for(int = 0; i < 10; i++)
{
Console.WriteLine(i);
}
}
I'm familiar with CodeIterationStatement and ...
0
votes
1
answer
182
views
What, if any, difference is there between a C# static class and a VB.NET Module
C# supports the static modifier on a class definition to define a class which cannot be inherited, is sealed, and has only static members. VB.NET supports Module statement to define a reference type ...
2
votes
1
answer
3k
views
C# CodeDomCompiler. error CS1056: Unexpected character '$'
My code is this:
public static bool CompileClient(out string[] errors)
{
using (CodeDomProvider provider = CodeDomProvider.CreateProvider("CSharp"))
{
CompilerParameters cp = ...
0
votes
1
answer
299
views
CodeDom not using MemberAttributes
When trying to learn CodeDom under Ms visual studio, I noticed that the code generation seems to ignore the member attributes set for my class.
This is my sample code
using Microsoft.CSharp;
using ...
0
votes
0
answers
167
views
How to get conditional statement using System.CodeDom like ? : not if-else block
Hi I am looking for little help here, I know I could generate code something like this
var conditionMethod = new CodeConditionStatement(conditionStmt);
conditionMethod.TrueStatements.Add(new ...
0
votes
1
answer
139
views
C# CodeDom System.TypeLoadException XamMac2 Xamarin macOS
I'm coding a complex application that makes use of CodeDom to instantiate objects with reflection. It is, however, mixed between netstandard2.0 (the wrapper in between that also supports net461) and ...
1
vote
2
answers
2k
views
Azure Build Pipeline: VSBuild fails on The CodeDom provider
My build pipeline (Microsoft-hosted agent) has been running every morning for a couple of months but this morning it suddenly failed on the VSBuild task. The error is described as:
"##[error]...
5
votes
1
answer
3k
views
Hosting Windows Forms Designer - Serialize designer at runtime and generate C# code
I am creating a designer surface and loading the controls to a runtime.
I am having issues when deserializing/loading the controls to the runtime.
All methods I have tried seem to have some type of ...
0
votes
0
answers
138
views
Referencing Assembly using File Path
I am using CodeDom/Reflection to compile a C# script from a file. My current code is:
string sourceCode = File.ReadAllText(item);
var compParms = new CompilerParameters
{
GenerateExecutable = ...
0
votes
2
answers
15k
views
How to fix ''System.ArgumentException" in c#?
I'm working on a small project that involves compiling code. I keep getting this error: An unhandled exception of type System.ArgumentException occurred in mscorlib.dll Illegal characters in path.
I'...
1
vote
0
answers
348
views
How to improve compile time using CSharpCodeProvider
I have an application where user can create its own formula it works fine
for all case but when i have DateTime Fields in my formula the compilation part of the code take around 132 ms for one formula ...
0
votes
1
answer
157
views
VB.NET/ import namespaces from codeDOM compiler
I encounter an error while compiling a project containing the import of a namespace.
I have a file called "Dissimulation.vb" in which the namespace "Dissimulation2" is declared. Here is his code:
...
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,...
2
votes
1
answer
241
views
Assign property values of an object in a CodeObjectCreateExpression
I need to create an object like this (see below) using CodeDOM.
internal static readonly Dynamic class1 = new Dynamic
{
VendorId = "VTS",
Test = 10.33f
};
What I did try has to create a ...