我试图CefSharp.OffScreen(41.0.0)在WCF服务应用程序中使用Nuget包,并在尝试从Visual Studio 2013运行服务时收到以下错误:
无法加载文件或程序集"CefSharp.BrowserSubprocess.Core.DLL"或其依赖项之一.指定的模块无法找到.
描述:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息.
异常详细信息:System.IO.FileNotFoundException:无法加载文件或程序集"CefSharp.BrowserSubprocess.Core.DLL"或其依赖项之一.指定的模块无法找到.
提到的程序集存在于项目的bin文件夹中,以及CefSharp网站上列出的所有必需程序集.如果实际上还需要另一个组件,我还没弄清楚它是什么.
还有一点值得一提:
CefSharp 从控制台应用程序或WPF应用程序引用时工作正常.我正在尝试使用C#作为使用CSharpCodeProvider(使用VS2010和.NET 4.0)的脚本语言.我希望脚本在具有最小权限的受限AppDomain中运行.目前,我在尝试在AppDomain中实例化一个类时遇到异常(对CreateInstanceAndUnwrap()的调用).以下是一些重现异常的简化代码:
using System;
using System.Collections.Generic;
using Microsoft.CSharp;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Security;
using System.Security.Policy;
using System.Security.Permissions;
using System.Reflection;
using System.Runtime.Remoting;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
// set permissions
PermissionSet permissions = new PermissionSet(PermissionState.None);
permissions.AddPermission(new SecurityPermission( SecurityPermissionFlag.Execution));
AppDomainSetup adSetup = new AppDomainSetup();
adSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
//Create a list of fully trusted assemblies
Assembly[] asms = AppDomain.CurrentDomain.GetAssemblies();
List<StrongName> sns = new List<StrongName>();
for (int x = 0; x < asms.Length; …Run Code Online (Sandbox Code Playgroud)