Click here to Skip to main content
15,886,578 members
Everything / CodeDOM

CodeDOM

CodeDOM

Great Reads

by honey the codewitch
Make your projects far more powerful with some foundational code templating techniques
by Matthew So (Hong Kong)
Use the GOLD Parser to define a language for mapping between two business entities, create a parser using the bsn-goldparser engine, and generate an assembly using CodeDom.
by honey the codewitch
If you use the CodeDOM, here's an indispensable package to make it awesome.
by Laszlo Frank
Visual Scripting with Pretty Good Temrinal

Latest Articles

by honey the codewitch
Generate fast, easy to use lexers/scanners in major .NET languages
by honey the codewitch
Make your projects far more powerful with some foundational code templating techniques
by honey the codewitch
Parse, analyze, and transform your code with Slang
by honey the codewitch
A completely programmable lexer/tokenizer/scanner generator in C# using a Pike Virtual Machine

All Articles

Sort by Score

CodeDOM 

28 Oct 2021 by honey the codewitch
Make your projects far more powerful with some foundational code templating techniques
6 Apr 2012 by Matthew So (Hong Kong)
Use the GOLD Parser to define a language for mapping between two business entities, create a parser using the bsn-goldparser engine, and generate an assembly using CodeDom.
11 Dec 2019 by honey the codewitch
If you use the CodeDOM, here's an indispensable package to make it awesome.
28 Oct 2013 by Sergey Alexandrovich Kryukov
Add appropriate "using" clause; unlike other syntactic features of the language, when you can use full type names or alias using, extension methods require "using" clause with the namespace where the extension method is declared.—SA
6 Dec 2019 by honey the codewitch
Implementing a visitor pattern over the CodeDOM
12 Jun 2013 by Prasad Khandekar
Hello,I think you will have to modify the code which generates the the second assignment statement as shown below.InitExpression = new CodeBinaryOperatorExpression(new CodeVariableReferenceExpression("root"), CodeBinaryOperatorType.Add, new CodePrimitiveExpression(resource.Value));Regards,
17 Feb 2017 by sameh obada
Implementation of mouse capturing for HTML5 Broswsers
26 Jul 2019 by honey the codewitch
A simple helper class to aid in code generation
30 Apr 2012 by petBorromeo
Hello Folks,I am new using codeDom and after some tutorials I was able to build interesting things. However I am facing a limitation regarding how to set custom attributes declaration for a method. e.g.[PexMethod (Max Branches = 1000)]public void myMethod()....I am able to...
30 Apr 2012 by Sergey Alexandrovich Kryukov
Attributes are powerful, useful, but very limited in several aspects. But — rejoice! — not that limited as you might think. They still allow some good set of parameter types:http://msdn.microsoft.com/en-us/library/ms177221%28v=vs.100%29.aspx[^].This is how it may look in your...
22 Apr 2013 by Prasad Khandekar
Hello,BadImageFormatExcept...
30 Nov 2013 by ianmartinez97
I am trying to create a program that will generate an executable based on user specified parameters that I add in as resources, but whenever I try to compile the program, all attempts to access the resources fail.In the program that will generate the EXE file, I have this code to compile the...
15 Oct 2015 by BillWoodruff
"Dynamic Type Using Reflection.Emit" by Abhishek Sur [^].You can create new Objects of any Type at run-time using Reflection and the System.Reflection.Emit namespace; however this is a pain in the butt to do (not something I've had a requirement to do, so far), and computationally...
16 Jan 2019 by Maciej Los
Seems you need to add a reference to: System.ComponentModel.DataAnnotations, then add a CodeAttributeDeclaration. See: var attr = new CodeAttributeDeclaration(new CodeTypeReference(typeof(System.ComponentModel.DataAnnotations.KeyAttribute))); Source: Add attribute using Codedom in C# - Stack...
25 Jul 2019 by Richard Deeming
Looks like the VBCodeProvider can't cope with empty arrays of generic types: referencesource/VBCodeProvider.cs at master · microsoft/referencesource · GitHub[^] When the array element type is a generic type, the value returned from GetTypeOutput will already contain parentheses - eg:...
27 Nov 2019 by honey the codewitch
A helper class that dramatically reduces the amount of code you need to write for the CodeDOM
12 Jul 2021 by Chris Copeland
CompilerParameters.ReferencedA...
19 Feb 2013 by Espen Harlinn
This does not work as expected:CodeMemberMethod finalize = new CodeMemberMethod();finalize.Name = "Finalize";finalize.Attributes = MemberAttributes.Override | MemberAttributes.FamilyOrAssembly;finalize.ReturnType = new CodeTypeReference(typeof(void));finalize.Statements.Add(new...
19 Feb 2013 by Zoltán Zörgő
As I see, the code generator has deep knowledge about the compiler - and that is quite straightforward. If you look at this MSDN page: http://msdn.microsoft.com/en-us/library/66x5fx1b.aspx[^], you will notice, that the code generator is skipping a step, and it is generating the code that the...
22 Apr 2013 by ali_heidari_
hey ...i used this code to compile a source in run time. Microsoft.CSharp.CSharpCodeProvider cscp = new Microsoft.CSharp.CSharpCodeProvider(); System.CodeDom.Compiler.CompilerParameters cp = new...
12 Jun 2013 by gwyder
HelloI am trying to generate this expression with CodeDom, I managed to make simpler ones, so I'm wandering if this is even possible to do? var codeGenerator = new CSharpCodeProvider().CreateGenerator(); var csp = new CSharpCodeProvider(new Dictionary...
23 Aug 2013 by thomasvanhaeren
Hello,The following problem keeps me from finalizing my project in Visual Basic. I must say that after many days of search, I did not find anything regarding this topic.Many of you are probably familiar with the CodeDOM compiler available in Visual Studio. Compiling applications with...
23 Aug 2013 by Ron Beyer
The Settings class (like a lot of the other My. items) are generated at compile time. My is a namespace, you would have to run the Settings class generator, or generate your own Settings class and add it to the My namespace for it to be available. Take a look at your settings code-behind to...
28 Oct 2013 by Mehdi Gholam
I'm trying to compile the following snippet with CodeDom:var res = from x in q.Rowsgroup x by x.Product into gselect new { Product = g.Key, TotalPrice = g.Sum(p => p.Price), TotalQTY = g.Sum(p => p.QTY)};return q.ToList();With the following references...
26 Jun 2014 by Dave Kreskowiak
No, you cannot "save a form as an .exe". It's simply not possible.You have to use the CodeDOM to build an entire application and then add your text that you sent to a label as a string constant into this app code. You then use CodeDOM to compile that code into it's own .EXE.Warning! It...
14 Jul 2014 by Member 8078971
Hello everybody, I'm having problems on reading some resources (images file .jpg) in my generated application from the CodeDOM.I really don't understand how all it work , I hope you can give me help.I'm trying to compilate a Test.Vb File with my source VB.NET code inside using Codedom ;...
30 Sep 2015 by iProgramIt
Hi guys,I have a piece of code, which I am compiling with CodeDOM. However, when I execute the program, it just says "The program has stopped working..".How can I fix this? The code in the CodeDOM program is here:Option Strict OnImports SystemImports System.Windows.FormsImports...
30 Sep 2015 by OriginalGriff
We can't tell. We can't run your program, and don't have access to your data if we could!So start by running it in the debugger - put an entry point at the start of the forms New method, and step your program through. Look carefully at each line before you execute it, and work out exactly what...
20 Oct 2015 by Sergey Alexandrovich Kryukov
You can do it via reflection:http://en.wikipedia.org/wiki/Reflection_(computer_programming)[^],https://msdn.microsoft.com/en-us/library/System.Reflection%28v=vs.110%29.aspx[^].Ideally, you need to define some commonly-known interface (let me call it "plug-in interface") and find the...
16 Jan 2019 by Priya-Kiko
Hi, I have this code for generating a class. namespace EFCodeFirstTest { class GenClass { CodeCompileUnit CompileUnit; CodeTypeDeclaration NewClass; public GenClass(String Classname) { CompileUnit = new CodeCompileUnit(); ...
25 Jul 2019 by honey the codewitch
sorry I don't speak VB, so here's the C# code I am trying to render with the CodeDom (this all works peachy rendering to C# just not VB) var value = new System.Collections.Generic.KeyValuePair[0]; var expression = CodeDomUtility.Serialize(value); (thanks to Richard Demming...
24 Jul 2019 by Member 9772125
Private Sub SurroundingSub() Dim kvp = KeyValuePair(Of Integer, String)(_) If True Then New KeyValuePair(Of Integer, String)(-21, New String From { "ab" }) End If End Sub
12 Jul 2021 by OriginalGriff
Right click your Project in the Solutions Pane and select "Add Reference". Locate System.ComponentModel in the Framework list and add it to the project.
27 Nov 2019 by honey the codewitch
Build a full featured tokenizer generator in C#
31 Dec 2019 by honey the codewitch
Use the Parsley compositional parser generator to parse a complicated grammar with backtracking.
19 Jan 2020 by honey the codewitch
A completely programmable lexer/tokenizer/scanner generator in C# using a Pike Virtual Machine
20 Nov 2023 by honey the codewitch
Generate fast, easy to use lexers/scanners in major .NET languages
9 Jan 2020 by honey the codewitch
Generate powerful, maintainable parsers in most major .NET languages using a friendly grammar format
3 Apr 2013 by Eric Reynolds
Quickly churn out repetitive C++, C#, or Java code from any data that Python can read.
4 Nov 2013 by Vitaliy Sytnik
On the Internet you can find a lot of different information about creating drawings in SVG format. Often an editor is used to open an DXF and export as SVG. Looking through the SVG code it is immediately obvious that there is a lot of excess. An SVG file created in one editor may not always be corre
5 Dec 2019 by honey the codewitch
An initial look at a tool to dramatically simplify language agnostic code generation using the CodeDOM
7 Dec 2019 by honey the codewitch
Getting an accurate CodeDOM back from a C# source subset
15 Dec 2019 by honey the codewitch
Code generation, faster
6 Jan 2020 by honey the codewitch
Using Parsley to parse a C# subset into the CodeDOM
26 Jun 2014 by DamithSL
This is alternative approach:how about creating exe which load configuration data from file? for example you can load the label text from text file and set it when form load. You only need to change the text file by other application.
26 Nov 2013 by Dave Kreskowiak
GetExecutingAssembly returns the currently executing assembly, i.e.: your application builder app, NOT the app you just created an .EXE for from your code.There is no native class in .NET to "edit" the resources of a seperate .EXE or .DLL file. You'll have to use a third party library, or...
15 Oct 2015 by Pedro Luis Gil Mora
Is there a way to accomplish this task. I've been trying to find a way on my own but It seems impossible to me. Thing is I want to bind class property's accessors using DataRowExtensions.Field and DataRowExtensions.SetField methods AT RUNTIME. I created my custom DataRow. It has de capability to...
26 Jun 2014 by Member 8078971
Hello everybody, hope I don't wrong anything.I'm trying to create a program in VB.NET and I'm going crazy, so if anyone could help me he would make a great favor! Here's the question : I have two form on my project;In form1 there is two button and one textbox, in form2 there is just...
20 Oct 2015 by Member 11551709
I am trying to access a class and its methods, properties, etc. from dynamically compiled code using the code dom. I can create and compile code fine using the code dom but I cant seem to get access to a class that is outside of the code dom compiled class. Is there a way I can add an object...
12 Jul 2021 by MohammedZr
I'm trying to develop a code compiler using C# but the problem is that I'm getting These Errors. Error: c:\Users\ss\AppData\Local\Temp\xxpatmuh.0.cs(3,14) : error CS0234: The type or namespace name 'ComponentModel' does not exist in the namespace...