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

C# dlr LanguageSetup setup for Script Runtime

Please does anyone know how to set up a C# ScriptEngine using Microsoft.CodeAnalysis.CSharp.Scripting var runtimeSetup = new ScriptRuntimeSetup(); LanguageSetup languageSetup = new LanguageSetup( "CSharp.Runtime.Context, CSharp", "CSharp", …
0
votes
0 answers

Attributes in CSharpCodeProvider

I try to compile some simple code (a c# class), which is using own Attribute. The CSharpCodeCompiler doesn't throw an error if my properties of class do not use the custom Attribute. this is my String: string _string = @" using System; using…
0
votes
0 answers

I want to copy all ".proto" files from one directory to another directory when i perform 'Build>Clean solution']

I am working with .proto files(Proto3) and I want to copy all the .proto files from one directory(Outside project) to another directory(Inside VS project) when i perform Build>Clean solution. Thanks in advance. I tried to modify "Visual C# Project…
0
votes
1 answer

Creating DLL using Csharpcodeprovider and adding Resources to it

I have a DLL reader to extract resources(images) from dynamically created DLL. In order to test it, I have developed a DLL to specify the requirements needed for my DLL reader to extract images. The DLL worked as expected as I can manually include…
ben Lim
  • 33
  • 5
0
votes
1 answer

Using dll that references assemblies already in project

So I have a project in Unity that is supposed to be able to load and instantiate classes from an assembly exported from another program. It goes like this: Necessary files are exported as DLL from Unity project Other program loads this DLL and…
0
votes
0 answers

How can i freeze the dialog if when it is not having proper parent?

I want to freeze reminder pop up dialog, it popes up once timer completes. But it goes in background. I want to freeze it and show it to top. I am not able to figure out how can i do that? As i don't have parent i am stuck to freeze this reminder…
0
votes
1 answer

c# - Microsoft.VisualC.CppCodeProvider missing

I wanted to compile c++ code at runtime in c# application.To compile c# code in c# application,i used CSharpCodeProvider(CodeDom).So,now i want to compile c++ code,i checked some resources,topics,and all of them says,to compile c++ code,i need to…
Byte
  • 55
  • 11
0
votes
1 answer

C# - Compile c# code at runtime with custom configuration

I has a question, does CodeDom Compiler can compile c# code with custom configuration such as x64 bit or x86 bit.By default it compiles c# code to .exe with "Any CPU" configuration. Compiling c# code: public static string BCS(string[]…
Byte
  • 55
  • 11
0
votes
0 answers

CSharpCodeProvider override, recompile or replace an existing function by dynamic compilation

I have looked every resources in the net and I could not find any answer! I want to know if its possible to override or recompile a function in the parent application by Dynamic Compilation, by using C# CSharpCodeProvider. I have provide a simple…
Emily Wong
  • 297
  • 3
  • 10
0
votes
1 answer

csharpcodeprovider: Can't use Process.Start()

So I'm making a WPF application where I'm using CSharpCodeProvider to compile code stored in string. Everything works great except for one part. When I try to use Process.Start(), it gives me "Metadata file 'System.Diagnostics.dll' could not be…
0
votes
1 answer

Complie runtime c# code in asp.net MVC

i need compile c# code at run time in asp.net mvc 5 when use this code throw exception "metadata MIS.dll not found." but when use code in console app my code run without error Generally, any namespace that is in .NET itself run without error, and…
D_ramezani
  • 11
  • 2
0
votes
2 answers

Could not load file or assembly "*.dll" , The system cannot find the file specified

Exception screenshot I am pretty sure the C:/test/AdPlatform.Shared.dll is exist. When I run this in Rider/VisoStudio, it works well. When I try to run it as a system service, it does not work. There is no error and it creates null instance.
li mars
  • 1
  • 1
  • 1
0
votes
1 answer

How do I grab what is written to console with CSharpCodeProvider

I use following to compile C# in runtime: CompilerParameters parameters = new CompilerParameters { GenerateInMemory = true, GenerateExecutable = true, IncludeDebugInformation = true }; …
Talha Talip Açıkgöz
  • 1,821
  • 4
  • 15
  • 28
0
votes
0 answers

How to Kill or Blocked request ID after use it by user in asp.net?

I have one page that contains a test for Microsoft Office for everyone. every once must to pay to do the test. student or someone need to has a request ID like 'v6c5th8lkfG'. Request id will send it by email or SMS messages. I need to block or kill…
0
votes
1 answer

CompilerParameters add Newtonsoft

I have the below script that uses CSharpCodeProvider and adds necessary system libraries. I've come into a situation where I need to include the Newtonsoft.Json.dll for the compiled program. Unfortunately, even though the dll is in the bin folder, I…
Kyle
  • 2,339
  • 10
  • 33
  • 67