1

我尝试 通过创建两个文件(start.csx 和 packages.config)并运行以下命令来运行以下示例https://github.com/scriptcs-contrib/scriptcs-servicestack/tree/master/sample

scriptcs -install
scriptcs start.csx

并遇到以下警告:

D:\TaskScheduler>scriptcs start.csx
WARN: Some assemblies failed to load. Launch with '-loglevel debug' to see the details
ERROR: D:\TaskScheduler\start.csx(1,29): error CS0246: The type or namespace name 'IReturn<HelloResponse>' could not be found (are you missing a using
directive or an assembly reference?)

知道如何解决这个问题吗?程序集存在于 bin 文件夹中(输出还表明它找到了它),但似乎缺少一些依赖项。我已经在我的机器上安装了 .NET 3.5、4.0 和 4.5,我正在使用 scriptcs v. 0.9.0

启用了“-loglevel debug”的输出。

D:\TaskScheduler>scriptcs start.csx -loglevel debug
DEBUG: Resolving ModuleLoader
DEBUG: Registering initialization services
DEBUG: Registering default: ScriptCs.Contracts.IFileSystem
DEBUG: Registering default: ScriptCs.Contracts.IAssemblyUtility
DEBUG: Registering default: ScriptCs.Contracts.IPackageContainer
DEBUG: Registering default: ScriptCs.Contracts.IPackageAssemblyResolver
DEBUG: Registering default: ScriptCs.Contracts.IAssemblyResolver
DEBUG: Registering default: ScriptCs.IModuleLoader
DEBUG: Resolving FileSystem
DEBUG: Loading modules from: C:\Users\robert\AppData\Local\scriptcs
DEBUG: Initializing modules
DEBUG: Modules initialized
DEBUG: Resolving ScriptServices
DEBUG: Registering runtime services
DEBUG: Registering default: ScriptCs.Contracts.IFileSystem
DEBUG: Registering default: ScriptCs.Contracts.IAssemblyUtility
DEBUG: Registering default: ScriptCs.Contracts.IPackageContainer
DEBUG: Registering default: ScriptCs.Contracts.IPackageAssemblyResolver
DEBUG: Registering default: ScriptCs.Contracts.IAssemblyResolver
DEBUG: Registering default: ScriptCs.Contracts.IScriptHostFactory
DEBUG: Registering default: ScriptCs.Contracts.IFilePreProcessor
DEBUG: Registering default: ScriptCs.Contracts.IScriptPackResolver
DEBUG: Registering default: ScriptCs.Contracts.IInstallationProvider
DEBUG: Registering default: ScriptCs.Contracts.IPackageInstaller
DEBUG: Registering default: ScriptCs.ScriptServices
DEBUG: Registering default: ScriptCs.Contracts.IObjectSerializer
DEBUG: Registering default: ScriptCs.Contracts.IConsole
DEBUG: Resolving AssemblyResolver
DEBUG: Found: D:\TaskScheduler\packages\ScriptCs.Contracts.0.3.2\lib\net45\ScriptCs.Contracts.dll
DEBUG: Found: D:\TaskScheduler\packages\ScriptCs.ServiceStack.0.1.0\lib\net45\ScriptCs.ServiceStack.Pack.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.ServiceInterface.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Common.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Interfaces.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.SqlServer.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.Redis.3.9.71\lib\net35\ServiceStack.Redis.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.Text.3.9.71\lib\net35\ServiceStack.Text.dll
DEBUG: Found package assembly: ScriptCs.Contracts.dll
DEBUG: Found package assembly: ScriptCs.ServiceStack.Pack.dll
DEBUG: Found package assembly: ServiceStack.dll
DEBUG: Found package assembly: ServiceStack.ServiceInterface.dll
DEBUG: Found package assembly: ServiceStack.Common.dll
DEBUG: Found package assembly: ServiceStack.Interfaces.dll
DEBUG: Found package assembly: ServiceStack.OrmLite.dll
DEBUG: Found package assembly: ServiceStack.OrmLite.SqlServer.dll
DEBUG: Found package assembly: ServiceStack.Redis.dll
DEBUG: Found package assembly: ServiceStack.Text.dll
DEBUG: Failure loading assembly: D:\TaskScheduler\packages\ScriptCs.ServiceStack.0.1.0\lib\net45\ScriptCs.ServiceStack.Pack.dll. Exception: Unable to
load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
DEBUG: Failure loading assembly: D:\TaskScheduler\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.dll. Exception: Unable to load one or more of th
e requested types. Retrieve the LoaderExceptions property for more information.
DEBUG: Failure loading assembly: D:\TaskScheduler\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.ServiceInterface.dll. Exception: Unable to load
one or more of the requested types. Retrieve the LoaderExceptions property for more information.
WARN: Some assemblies failed to load. Launch with '-loglevel debug' to see the details
DEBUG: Found: D:\TaskScheduler\packages\ScriptCs.Contracts.0.3.2\lib\net45\ScriptCs.Contracts.dll
DEBUG: Found: D:\TaskScheduler\packages\ScriptCs.ServiceStack.0.1.0\lib\net45\ScriptCs.ServiceStack.Pack.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.ServiceInterface.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Common.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Interfaces.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.SqlServer.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.Redis.3.9.71\lib\net35\ServiceStack.Redis.dll
DEBUG: Found: D:\TaskScheduler\packages\ServiceStack.Text.3.9.71\lib\net35\ServiceStack.Text.dll
DEBUG: Found package assembly: ScriptCs.Contracts.dll
DEBUG: Found package assembly: ScriptCs.ServiceStack.Pack.dll
DEBUG: Found package assembly: ServiceStack.dll
DEBUG: Found package assembly: ServiceStack.ServiceInterface.dll
DEBUG: Found package assembly: ServiceStack.Common.dll
DEBUG: Found package assembly: ServiceStack.Interfaces.dll
DEBUG: Found package assembly: ServiceStack.OrmLite.dll
DEBUG: Found package assembly: ServiceStack.OrmLite.SqlServer.dll
DEBUG: Found package assembly: ServiceStack.Redis.dll
DEBUG: Found package assembly: ServiceStack.Text.dll
DEBUG: Initializing script packs
DEBUG: Starting pre-processing
DEBUG: Processing start.csx...
DEBUG: Pre-processing finished successfully
DEBUG: Starting execution in engine
DEBUG: Starting to create execution components
DEBUG: Creating script host
DEBUG: Creating session
DEBUG: Adding reference to System
DEBUG: Adding reference to System.Core
DEBUG: Adding reference to System.Data
DEBUG: Adding reference to System.Data.DataSetExtensions
DEBUG: Adding reference to System.Xml
DEBUG: Adding reference to System.Xml.Linq
DEBUG: Adding reference to D:\TaskScheduler\packages\ScriptCs.Contracts.0.3.2\lib\net45\ScriptCs.Contracts.dll
DEBUG: Adding reference to D:\TaskScheduler\packages\ScriptCs.ServiceStack.0.1.0\lib\net45\ScriptCs.ServiceStack.Pack.dll
DEBUG: Adding reference to D:\TaskScheduler\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.dll
DEBUG: Adding reference to D:\TaskScheduler\packages\ServiceStack.3.9.71\lib\net35\ServiceStack.ServiceInterface.dll
DEBUG: Adding reference to D:\TaskScheduler\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Common.dll
DEBUG: Adding reference to D:\TaskScheduler\packages\ServiceStack.Common.3.9.71\lib\net35\ServiceStack.Interfaces.dll
DEBUG: Adding reference to D:\TaskScheduler\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.dll
DEBUG: Adding reference to D:\TaskScheduler\packages\ServiceStack.OrmLite.SqlServer.3.9.71\lib\net35\ServiceStack.OrmLite.SqlServer.dll
DEBUG: Adding reference to D:\TaskScheduler\packages\ServiceStack.Redis.3.9.71\lib\net35\ServiceStack.Redis.dll
DEBUG: Adding reference to D:\TaskScheduler\packages\ServiceStack.Text.3.9.71\lib\net35\ServiceStack.Text.dll
DEBUG: Importing namespace System
DEBUG: Importing namespace System.Collections.Generic
DEBUG: Importing namespace System.Linq
DEBUG: Importing namespace System.Text
DEBUG: Importing namespace System.Threading.Tasks
DEBUG: Importing namespace System.IO
DEBUG: Starting execution
DEBUG: Finished execution
DEBUG: Terminating packs
ERROR: D:\TaskScheduler\start.csx(1,29): error CS0246: The type or namespace name 'IReturn<HelloResponse>' could not be found (are you missing a using
 directive or an assembly reference?)
DEBUG: Roslyn.Compilers.CompilationErrorException: D:\TaskScheduler\start.csx(1,29): error CS0246: The type or namespace name 'IReturn<HelloResponse>'
 could not be found (are you missing a using directive or an assembly reference?)
   at Roslyn.Scripting.CommonScriptEngine.CompilationError(DiagnosticBag localDiagnostics, DiagnosticBag diagnostics)
   at Roslyn.Scripting.CommonScriptEngine.Compile(String code, String path, DiagnosticBag diagnostics, Session session, Type delegateType, Type return
Type, CancellationToken cancellationToken, Boolean isInteractive, Boolean isExecute, CommonCompilation& compilation, Delegate& factory)
   at Roslyn.Scripting.CommonScriptEngine.CompileSubmission[T](String code, Session session, String path, Boolean isInteractive)
   at ScriptCs.Engine.Roslyn.RoslynScriptEngine.Execute(String code, Session session)

D:\TaskScheduler>
4

0 回答 0