126 questions
-1
votes
1
answer
139
views
How to execute dynamic C# code (with logic/formulas) in a browser-side React app without a server?
In my current desktop application, I evaluate dynamic C# formulas at runtime using CodeDomProvider. The formulas are written as C# snippets, and from each snippet I generate a full class and method, ...
0
votes
1
answer
34
views
razor library loading views from different location
My app implements plugin system (razor libraries). App is using razor runtime compilation. Razor library contains few ViewComponents with custom structure described below.
Razor library structure:
...
3
votes
1
answer
649
views
C# runtime compilation complains The type 'Object' is defined in an assembly that is not referenced
I am trying to use Roslyn to compile C# code at runtime. My compilation function is as follows:
using System.Collections.Immutable;
using Basic.Reference.Assemblies;
using Microsoft.CodeAnalysis;
...
0
votes
1
answer
217
views
Blocking operator==() at compile time
I have an ID-Record class and I want to block callers / users from using the operator== since it is ambiguous (user may want to compare only data field for equality).
Here's my class:
#include <...
0
votes
1
answer
136
views
How to runtime compile with reflection for a class being used within another class
My code:
import scala.reflect.runtime
import scala.reflect.runtime.universe
import scala.reflect.runtime.universe._
import scala.tools.reflect.ToolBox
object Stuff {
val rm: universe.Mirror = ...
0
votes
0
answers
48
views
How to get the properties name, type and other info from a class gotton through CSharpCompilation.Create()?
I've previously asked a question "How to get the Type of an Array of Nullable Primitive?" How to get the Type of an Array of Nullable Primitive?.
In that question, I have a class in my c# ...
1
vote
1
answer
811
views
How can I run generated code during script runtime?
During the running of a scala script, I would like it to generate some code and execute this.
I thought I had found two examples online that might work, but they aren't successful
import scala.reflect....
0
votes
0
answers
197
views
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 = @"
...
0
votes
1
answer
37
views
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 ....
1
vote
1
answer
1k
views
Dependency inject a custom file provider for runtime compilation
I am experimenting with loading views from a database, and as suggested in the article one might want to add some caching to prevent hitting the database every time.
ConfigureServices:
services....
0
votes
0
answers
55
views
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 ...
0
votes
1
answer
1k
views
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 ...
2
votes
0
answers
246
views
Parallel compilation of java classes in runtime
I want to compile java classes in runtime in parallel. Since it takes time to compile them sequentially.
I used OpenHFT/Java-Runtime-Compiler (https://github.com/OpenHFT/Java-Runtime-Compiler, version ...
2
votes
1
answer
2k
views
the project must provide a value for configuration Error when install Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation in Core3.1
When I install Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation in a Web project and in Startup add :
services.AddMvc().AddRazorRuntimeCompilation();
,the project does not run and the error is:
...
-1
votes
1
answer
558
views
What is "runtime compilation" in Javascript?
I'm reading this article on regular expressions, and it says "Using the constructor function provides runtime compilation of the regular expression". It then says "Use the constructor function when ...
1
vote
1
answer
180
views
C# Is there a way I can compile an exe
When people download my project from GitHub, I launch a Setup Guide on Start Up that contains a button that reads 'Launch Connection String Builder'.
The problem is GitHub doesn't store the .exe, so ...
0
votes
1
answer
237
views
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 ...
3
votes
1
answer
248
views
How to compile s-expression at runtime and then execute it in Common Lisp
I am working on a program that generates program (Genetic Programming). I build at runtime an s-expression and today I use eval like this:
(defvar *program* '(+ x 1))
(defvar x 10)
(eval *program*) ;;...
1
vote
1
answer
836
views
C++ Make a Program Write Over Itself
I posted a question on a similar topic a couple days ago (and one a couple years ago), but I decided to go ahead and get started. I am trying to inject C++ code into C++ code (in a somewhat portable ...
5
votes
1
answer
2k
views
Using Roslyn to parse a lambda expression of a runtime generated type
I'm trying to use Roslyn as a way to parse lambda expressions provided at runtime by users using the general format:
// The first line is normally static and re-used across callers to save perf
...
2
votes
0
answers
620
views
Compiling multiple assemblies at run-time using Roslyn
I am trying to Create multiple assemblies at runtime. I am using Roslyn to compile each assembly in serial.
I am not able to leverage multithreading because Roslyn internally uses multithreading for ...
1
vote
0
answers
251
views
Roslyn slower than CodeDom
I am using Roslyn to generate a runtime dll using a number of VB files on disk.
I am first creating syntax trees from all those files and then using them for creating VBCompilation and them emitting ...
1
vote
0
answers
97
views
Issue dynamically Compiling VB code
When I compile VB code using CodeDom, I need not specify fully qualified path for system references. For example:
Dim param As New CompilerParameters
param.ReferencedAssemblies.Add("System.dll")
...
1
vote
1
answer
594
views
Python - using multi-processing / multi threading for web scraping
I am using wikipedia python package to scrape data of a particular topic
q=['NASA', 'NASA_insignia', 'NASA_spinoff_technologies', 'NASA_facilities', 'NASA_Pathfinder', 'List_of_NASA_missions', '...
0
votes
1
answer
582
views
Render Angular 4 component with text coming in from an API
I want to render incoming text from an API as subsequent HTML and component template.
Most of the solutions I found here use @ViewChild to inject the components but that doesn't work for me since I ...