mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
Replace CS-Script.Core To Natasha
This commit is contained in:
parent
d4bf205c79
commit
8ddf117fc7
@ -22,11 +22,8 @@
|
|||||||
<None Include="../../logo.png" Pack="true" PackagePath="\" />
|
<None Include="../../logo.png" Pack="true" PackagePath="\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
|
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
|
||||||
<PackageReference Include="CS-Script.Core" Version="1.2.3" />
|
<PackageReference Include="DotNetCore.Natasha" Version="2.12.0" />
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
|
|
||||||
<PackageReference Include="CS-Script.Core" Version="1.3.1" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
|
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1'">
|
||||||
|
@ -10,19 +10,12 @@ namespace FreeSql.Extensions.LazyLoading
|
|||||||
{
|
{
|
||||||
|
|
||||||
#if ns20
|
#if ns20
|
||||||
internal static Lazy<CSScriptLib.RoslynEvaluator> _compiler = new Lazy<CSScriptLib.RoslynEvaluator>(() =>
|
|
||||||
{
|
|
||||||
var compiler = new CSScriptLib.RoslynEvaluator();
|
|
||||||
compiler.DisableReferencingFromCode = false;
|
|
||||||
compiler
|
|
||||||
.ReferenceAssemblyOf<IFreeSql>()
|
|
||||||
.ReferenceDomainAssemblies();
|
|
||||||
return compiler;
|
|
||||||
});
|
|
||||||
|
|
||||||
public static Assembly CompileCode(string cscode)
|
public static Assembly CompileCode(string cscode)
|
||||||
{
|
{
|
||||||
return _compiler.Value.CompileCode(cscode);
|
Natasha.AssemblyComplier complier = new Natasha.AssemblyComplier();
|
||||||
|
//complier.Domain = DomainManagment.Random;
|
||||||
|
complier.Add(cscode);
|
||||||
|
return complier.GetAssembly();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user