Ich versuche, IronPython zu einer .NET Core 1.0-Webanwendung hinzuzufügen, aber Probleme beim Zugriff auf die ScriptRuntime-Klasse. Wenn ich versuche, using IronPython;
hinzuzufügen, erhalte ich Fehler, die besagen, dass IronPython nicht gefunden wurde.So verwenden Sie IronPython mit .Net Core 1.0
Ich habe auch Fehler über ScriptRuntime does not exist in the current context
Hinweis: derzeit mit Visual Studio-Code auf OSX 10.11
Die folgenden sind t der Abhängigkeiten und Rahmenabschnitte meiner project.json:
{
"version": "1.0.0-*",
"dependencies": {
"EntityFramework.Commands": "7.0.0-rc1-final",
"EntityFramework.Sqlite": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"Microsoft.AspNet.Authentication.Cookies": "1.0.0-rc1-final",
"Microsoft.AspNet.Diagnostics.Entity": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"Microsoft.AspNet.Tooling.Razor": "1.0.0-rc1-final",
"Microsoft.Dnx.Runtime": "1.0.0-rc1-final",
"Microsoft.Extensions.CodeGenerators.Mvc": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final",
"Microsoft.NETCore.Platforms": "1.0.1-*",
"Newtonsoft.Json": "8.0.3",
"IronPython": "2.7.5",
"IronPython.StdLib": "2.7.5"
},
"commands": {
"web": "Microsoft.AspNet.Server.Kestrel",
"ef": "EntityFramework.Commands"
},
"frameworks": {
"dnx451": {},
"dnxcore50": {}
},
}
Und in meinem Controller habe ich die folgenden Anweisungen verwenden:
using System.IO;
using System.Diagnostics;
using Microsoft.AspNet.Authorization;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc;
using Microsoft.Net.Http.Headers;
using Newtonsoft.Json.Linq;
using MatrixSynthesisWebApp.Models;
using System.Dynamic;
using System.Runtime.CompilerServices;
using IronPython;
Angesichts der Tatsache, dass die letzte IronPython-Veröffentlichung wesentlich älter ist als die Einführung von .net-Kern, wird dies wahrscheinlich ohne eine IronPython-Build-Targeting-.net-Kern nicht funktionieren. –