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...
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!
...
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" },
...
};
...
Is it possible to load the CodeDOM from a .NET binary created using C#?
...
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()
...
What are the differences between Expression trees and CodeDom?
Which should I use for which scenario?
...
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",
...
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
...
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?
http://msdn.microsoft.com/en-us/library/y2k85ax6.aspx
new features
bug fixes
things marked as obsolete
...
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...
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...
if ((x == 1 && y == "test") || str.Contains("test"))
...
how to generate condition in the if block by CodeDOM or LinqExpression Dynamiclly with C#?
...
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...
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 ...
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...
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...
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...
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...
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?
...