Closed
Description
I'm running a .NET 7 WPF app with a reference to CSScriptLib nuget.
My project works great and scripts run right in debug mode. When I publish I get the error:
"Current version of Roslyn-based evaluator does not support referencing assemblies which are not loaded from the file location."
I publish to a single file which merges most of the referenced dlls into a single dll. Looks like this code in Evaluator.Roslyn.cs is having a problem with it:
public override IEvaluator ReferenceAssembly(Assembly assembly)
{
//Microsoft.Net.Compilers.1.2.0 - beta
if (assembly.Location.IsEmpty())
I checked this in my code when publishing both to many files and to a single file and in the latter case Location is empty.
if (string.IsNullOrEmpty(typeof(IRunScriptAsync).Assembly.Location))
throw new System.Exception("Assembly.Location is empty");