codedom

CodeDom : compile partial class

大憨熊 提交于 2021-01-27 14:42:26
问题 I'm attempting to compile code in a text file to change a value in a TextBox on the main form of a WinForms application. Ie. add another partial class with method to the calling form. The form has one button (button1) and one TextBox (textBox1). The code in the text file is: this.textBox1.Text = "Hello World!!"; And the code: namespace WinFormCodeCompile { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { //

C# / .NET - CodeDom.Compiler Set Assembly Info Attributes

僤鯓⒐⒋嵵緔 提交于 2020-07-03 10:18:46
问题 I am new to C# and am trying to use .NET's CodeDom.Compiler to compile an application and properly generate the assembly information in the outputted exe. I've been looking in the MS Docs / Class reference to do so. Is it possible to set the assembly information during compilation? Code to compile my source code: CompilerParameters CParams = new CompilerParameters(); CParams.GenerateExecutable = true; CParams.OutputAssembly = Output; string options = "/optimize+ /platform:x86 /target:winexe

C# and Metadata File Errors

眉间皱痕 提交于 2020-01-24 15:55:29
问题 I've created my own little c# compiler using the tutorial on MSDN, and it's not working properly. I get a few errors, then I fix them, then I get new, different errors, then I fix them, etc etc. The latest error is really confusing me. --------------------------- --------------------------- Line number: 0, Error number: CS0006, 'Metadata file 'System.Linq.dll' could not be found; --------------------------- OK --------------------------- I do not know what this means. Can somebody please

FSharp.Compiler.CodeDom for VS2008 and VS2010 side-by-side

五迷三道 提交于 2020-01-24 14:16:25
问题 I'm using FSharp.Compiler.CodeDom (from the PowerPack) to dynamically create F# classes. The problem is, that I have both VS2008 and VS2010 on my computer side-by-side (they works fine), and using F# in this configuration is buggy at best: If I don't install InstallFSharp.msi, then under VS2008 the built classes complain about not finding FSharp.Core (even if they're referenced) If I install InstallFSharp.msi, then under VS2008 the built classes will use the F# built for VS2010, and will

Hosting Windows Forms Designer - Serialize designer at runtime and generate C# code

情到浓时终转凉″ 提交于 2020-01-21 09:11:25
问题 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 issue. Issued faced for example: Controls are still bound of the design-time Not all properties deserialize with all the properties, namely nested properties. Control associations does seem to be followed, i.e. Button in a Panel, will not be in the panel anymore, even though the property is still

Reflect, generate, compile, execute, disassemble, decompile, reflect

安稳与你 提交于 2020-01-17 07:01:12
问题 Before heading back to business, I decided to take a few days off for recreational coding. A few 30-hour days without fresh air? Sounds fantastic, for a change. I've struggled with managed code generation over time and always wondered if there is a circular relationship between C# code, reflection and codedom. Never got around to exploring it sadly. So the goal is to create useless and annoyingly complex classes with nested generics, constraints, anonymous methods, delegates, nested complex