codedom

Using Linq methods causes missing references to DependencyObject in WindowsBase

I have some c# source that I want to compile using CodeDom within my application (for a plugin) Everything works fine, except if I use a Linq extension function on some of my collections var dict = new Dictionary<KeyType, ValueType>(); .... dict.Any(KV=>KV.Key == "Some Key"); When I try to compile source that has this code, it CodeDo...

Generating unmanaged C++ via CodeDom

Hello, I'm looking to programmatically generate unmanaged C++ code via CodeDom. It seems that the default implementation of CppCodeProvider is only capable of generating managed C++/CLI. Any alternatives out there? Thanks! ...

CodeDom and collection initializers

Is there a way to generate a dictionary initializer using the C# CodeDom? Are those supported at all? I would like to have: private IDictionary<string, string> map = new Dictionary<string, string> { { "Name", "Value" }, ... }; ...

Load the code DOM from a binary

Is it possible to load the CodeDOM from a .NET binary created using C#? ...

Extension Method in Dynamically Generated Assembly?

I'm trying to include an extension methods static class in a dynamically generated assembly, except that i keep getting a compiler error of 'Type expected' at line 6, column 28, which happens to be on the word 'this'. If i remove 'this' no error is returned (but then it is not an extension method). public static void CodeDomDooDad() ...

C# 4.0: Expression trees vs. CodeDom

What are the differences between Expression trees and CodeDom? Which should I use for which scenario? ...

CodeDom compiler does not use executable directory for assembly references

I have a CodeDom setup that needs to reference some assemblies that are in the executable's directory. However, it appears that only the Working Directory and the GAC are searched for these assemblies, and not the executable directory. var compilerOptions = new CompilerOptions { ReferencedAssemblies = { "System.dll", ...

How to specify CppCodeProvider on command line of svcutil.exe?

I am trying to use svcutil to generate managed C++ code from XSD. The command line I am using is "C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\xsd.exe" MyTest.xsd /classes /language:"Microsoft.VisualC.CppCodeProvider7, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /namespace:MyTestApp ...

How to execute the code generated by codeDom?

i just generated the .cs file using codeDom.will u plz tel how to execute that .cs file. ...

Are there any changes to the CodeDom API in .net 4?

Are there any changes to the CodeDom API in .net 4? http://msdn.microsoft.com/en-us/library/y2k85ax6.aspx new features bug fixes things marked as obsolete ...

How do I access the CodeDomProvider from a class inheriting from Microsoft.VisualStudio.TextTemplating.VSHost.BaseCodeGeneratorWithSite?

Does anyone know how to get a CodeDomProvider in the new Microsoft.VisualStudio.TextTemplating.VSHost.BaseCodeGeneratorWithSite from the Visual Studio 2010 SDK? I used to get access to it just by in mere inheritance of the class Microsoft.CustomTool.BaseCodeGeneratorWithSite, but now with this new class it is not there. I see a GlobalSer...

Can CodeDom add Source Code Files to a Project?

I have been using CodeDom to do some code generation. It works great, but I haven't found a way to include the generated source code files in a project. I started using T4 and the T4Toolbox to generate code because it supports integration with project files. Does anyone know if CodeDom supports this functionality too? I'd consider taki...

how to generate if condition block by CodeDOM or LinqExpression Dynamiclly?

if ((x == 1 && y == "test") || str.Contains("test")) ... how to generate condition in the if block by CodeDOM or LinqExpression Dynamiclly with C#? ...

Removing items in code generated from Codedom

Is there a way to remove items in code generated in Codedom from VB code? For example at the top of all the code I generate, it has: '------------------------------------------------------------------------------ ' ' This code was generated by a tool. ' Runtime Version:4.0.30319.1 ' ' Changes to this file may cause incorre...

Codedom and string handling

I've researched on this but couldn't find anything solid and wanted to see if someone can point me in the right direction. I'm trying to see if Codedom can handle strings and concantination between different languages, without me setting up conditional strings per language. For example, I need to generate the following exactly as shown ...

How to implement "Handles" via Codedom

I've been trying figure out how to add a handler to a method using Codedom, but am not getting very far. The method I want to reproduce via Codedom is: Private Sub Startup() Handles btnStart.Click ''# Do work End Sub The method is easy enough to create with: Dim StartupMethod As New CodeMemberMethod StartupMethod.Name = "Startup...

How can I use CodeDOM to create and load an assembly in an AppDomain?

I am working on a project that will use CodeDOM to create a class that evaluates a user-defined expression, creates an assembly for the class, and loads the assembly. Since there can be a fair number of user-defined expressions, I would like to first create an AppDomain, execute the CodeDOM creation/loading and executing for the assembl...

why am I getting "error CS0016 : process cannot access ...", when I recompile the dynamically compiled and unloaded dll.

hello, in my application, i use CSharpCodeProvider class to dynamically create a dll file and load the file into another appdomain to use the class in it. when i am done with the class, i simply unload the appdomain. everything is perfect so far. but if i try to recompile the dll at runtime, i get the following error. E:\projects\Com...

An alternative for "CSharpCodeProvider.Parse"

Hello all, I'm looking for an alternative for CSharpCodeProvider.Parse. The method was supposed to parse a [C#] code source and return a CompileUnit object. However, the method isn't implemented in any .Net framework. My purpose is to be able to navigate a C# CodeDOM without having to compile it. I'm writing a application that does som...

How to generate c# code?

I'm writing a desktop application. It would need to generate c# code on client machines. I thought of using CodeDOM (complex) or simple string manipulations (fragile). What else? Which way is recommended? ...