Questions tagged [runtime-compilation]

Use this tag for questions related to Runtime Compilation, i.e. the compilation of a program during Runtime.

is used in its general meaning, and is usually accompanied by Java, C based languages, Scala, ASP.NET, etc. .

123 questions
0
votes
0 answers

C# compile at runtime in unity, issues with ucompiler

I found Ucompile but seems like it isn't supported anymore. I also found Roslyn but don't want to pay for a hobby project. So I installed uCompiler but it tells me that "AppDomain does not contain a definition for CreateInstanceFromAndUnwrap" Tried…
0
votes
0 answers

SQL Server errors out prematurely when starting a batch, for an error that will not actually occur

The code below results in error when a table [mytable] exists and has a columnstore index, even though the table will have been dropped and recreated without columnstore index before page compression is applied to it. drop table if exists…
0
votes
0 answers

How to use function from my code in runtime-compiled code?

I know that I can compile function at runtime and use code copied from this CodeProject article: public static MethodInfo CreateFunction(string function) { string code = @" using System; namespace…
DrWh0
  • 126
  • 7
0
votes
1 answer

View page from ProjectReference not reflected without restarting main project asp.net MVC C#

I am building a shared UI - razor page in a Lib project (Visual Studio), the purpose is to add the Lib project as ProjectReference to multiple places. I am stuck at finding a way to reflect the .cshtml changes immediately to the browser without…
Tien Dang
  • 41
  • 2
  • 3
0
votes
2 answers

Java - accessing strings in non-compiled .java files during runtime

I've got a problem for you. I've got a bunch of Java files (.java) sitting around and they all contain a class declaration and an array of strings. I need to do stuff with the array. What is the best way to access it? I tried using JavaCompiler…
0
votes
0 answers

Compile java file at runtime if class has other dependencies

The implementation of the following functionality is required - the user writes code on the site, for example, a method or class in java is sent for verification. The system checks the code for compilation and tests the business logic of the method…
0
votes
0 answers

Please explain this recursion problems time taken to run

Let me start by saying that I am only perhaps at an intermediate level in coding, but am not too familiar with DS and Algo. I wrote this bit of code that returns the sum of a given number of elements from an array above a certain value, where : h :…
0
votes
1 answer

Add Embedded Resource to specific path from Assembly compiled at Runtime

public void Compile() { string OutputPath = Application.dataPath + "/" + Path.Combine(Consts.OutputPath, DLLName) + ".dll"; Debug.Log(OutputPath); var csc = new CSharpCodeProvider(new Dictionary() { {…
0
votes
1 answer

Runtime compiling DbContext with EF core, missing reference for Migrator()

I'm building an app that requires a EntityFrameWorkCore DbContext to be created runtime and then migrated, the code below compiles and runs if i don't use the dbContext.Database.Migrate() method, but if i do i get a diagnositcs error about missing a…
0
votes
2 answers

AddRazorRuntimeCompilation not working when working directory is changed

I'm using newest .Net 5 RC2. For some reason when I run debug, working directory is set to project directory, not "bin\Debug\net5.0-windows". That causes some problems because I use some shared files from other projects (they are all copied into one…
0
votes
4 answers

Compile piece of code dynamically and add it to the current class

I want to create several properties on the fly inside the class' constructor and add them to the current class. The property's template is the following public [PropertyType] [PropertyName] { get {return Container.Resolve();} } I've read a little…
user759141
  • 577
  • 1
  • 6
  • 11
0
votes
1 answer

Java program split between folders

So I want to develop a small game engine. This has the main engine classes like a Vector and Actor for the user to use. Since I only need the engine once, I want to make the games use the same engine, and to avoid having all games in the same jar, I…
user10699646
0
votes
1 answer

How do I pass parameters in run-time compilation in c#, winforms?

I'm stuck on run-time compilation and CodeDom. Here's a simplified example of what I have so far. public static void Testing() { CodeDomProvider codeProvider = CodeDomProvider.CreateProvider("CSharp"); string Output =…
tube-builder
  • 686
  • 1
  • 13
  • 29
0
votes
1 answer

CompileAssemblyFromDom with many-to-may relation

I have two classes. public class Student{ public List Courses {get;set;} } public class Course{ public Student Student {get;set;} } I need to compile them each in separate assembly. CompileAssemblyFromDom argues that it…
Vladimir Nani
  • 2,774
  • 6
  • 31
  • 52
0
votes
1 answer

C# Roslyn to use previously compiled class in next compilations

I ask with example, Lets say I have the following code. fullcommand = @"public class oldTest { public static void oldTestMethod(){ Console.WriteLine(""oldTest Class""); } }" var syntaxTree =…
Emily Wong
  • 297
  • 3
  • 10
1 2 3
8 9