Questions tagged [csharpcodeprovider]

.NET class that provides access to the C# compiler for compiling code.

CSharpCodeProvider can be used by applications to compile C# source code from in-memory strings or from files on disk, producing in-memory compiled assemblies or DLL files on disk.

153 questions
0
votes
1 answer

Compile entire project from another project

I have a Windows Forms application, which I use to generate resource files. I'm trying to add such functionality to this application, that would allow me to compile another Windows Forms application into an executable, that would have these…
Dygestor
  • 1,259
  • 1
  • 10
  • 20
0
votes
1 answer

Passing and using a list in CodeDom dynamic method

I am trying to use a simple static method to return an object to dynamically evaluate an expression. I have followed the advice outlined in the examples here: http://www.blackwasp.co.uk/RuntimeCompilation_2.aspx For basic expressions this is…
spotvader
  • 35
  • 4
0
votes
2 answers

Compiling with a resource file using CSharpCodeDomProvider

I am trying to build a program which will compile one .cs with an xml file as a resource. I have the following code for compiling: private void Builder(bool run) { CodeDomProvider compiler = CodeDomProvider.CreateProvider("CSharp"); string…
themightymanuel
  • 155
  • 2
  • 9
0
votes
0 answers

FileLoadException when using CompileAssemblyFromDom

I believe this is a permissions issue but I don't know how to solve it, I receive the following exception: System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host. at…
Anupheaus
  • 3,383
  • 2
  • 24
  • 30
0
votes
1 answer

Compile LINQ query that uses external data source using CSharpCodeProvider

I have a query that I need to create as a string, transport over WCF and and then compile into LINQ at the other end. The reason that I'm not transporting the actual LINQ query itself over WCF is because the method which produces the query should…
user2766816
  • 21
  • 1
  • 3
0
votes
1 answer

CSharpCodeProvider does not see the Stack class under System.Collections.Generic

I'm building a pseudocode translator and compiler. It translates the pseudocode to code by performing several string operations, then it uses the CSharpCodeProvider class to compile it, and finally it tries to run it. After a few tests, in the case…
0
votes
1 answer

CSharpCodeProvider set and verify .NET profile version

I'm using mono for an embedded scripting environment in my application. For the compilation of the scripts I use Microsoft.CSharp.CSharpCodeProvider. Now I require some 4.0 or 4.5 Functionality like System.Numerics. However, referencing the…
FFox
  • 1,550
  • 2
  • 17
  • 26
0
votes
0 answers

Non-Static variables scripting in runtime c#

I'm creating some scripts and running them in runtime, but I'm compiling them only once(unless the code changes) to avoid "memory leak", since everytime I compile a script it take X Kbs from the memory. Anyway, I'm trying to find a way to use…
Kyky
  • 63
  • 1
  • 7
0
votes
1 answer

Compile ascx files into DLL at runtime

In our ASP.NET application we allow other developers to write asp.net code and we compile their code into in-memory dll. As part of this we would like to be able to compile ASCX controls into DLL at runtime and then later on load them into Aspx…
sam360
  • 1,121
  • 3
  • 18
  • 37
-1
votes
1 answer

c# - compile c# code at runtime with roslyn

I checked some resource about roslyn,and i not found how to compile c# sources to executable with Roslyn.I can easily compile some .cs files to .exe using CodeDom: /// /// "anycpu" || "anycpu32bitpreferred" || "x86" || "x64" ||…
Byte
  • 55
  • 11
-1
votes
1 answer

C# - Compiling C# code at runtime results in errors that is "nonexistent"

I'm trying to compile multiple C# files into one executable at runtime and I keep getting compiler errors that aren't present if I run this code from Visual Studio. The specific errors I'm getting from my runtime compiler is "; expected" and…
Hertzole
  • 73
  • 8
-1
votes
1 answer

How to compile a serializable object at runtime using C# CSharpCodeProvider and BinaryFormatter

So, I have the following code as text: using digitracktest.DigiTrack.CoreLogic; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Script.Serialization; using…
-1
votes
1 answer

CsharpCodeProvider memory leak

Someone helped me to run some codes in runtime using a timer, but after a while I saw that it is just using memory and not releasing it. I hear something about AppDomain, but I didn't figure out where to use it. AppDomain would help me with that…
Kyore
  • 388
  • 2
  • 7
  • 29
-2
votes
1 answer

Publish C# Desktop Application with SQL Server database

I have a Visual Studio project that has different Windows Forms and a SQL Server database attached. I want to install this project on my client computer (others). As I haven't published any project before, can someone guide me in an easy way. When I…
gmJ
  • 9
  • 3
-2
votes
2 answers

The ConnectionString property has not been initialized. Error in C# web application

Here is my code: using System; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; namespace EmployeeSys { public partial class WebForm1 : System.Web.UI.Page { …
1 2 3
10
11