Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法编译自定义插件程序集_C#_Asp.net_Reflection_Iis 7_.net Assembly - Fatal编程技术网

C# 无法编译自定义插件程序集

C# 无法编译自定义插件程序集,c#,asp.net,reflection,iis-7,.net-assembly,C#,Asp.net,Reflection,Iis 7,.net Assembly,我有一个用C#编写的web应用程序插件。当应用程序调用它时,插件程序集无法编译 我已经找到了问题的症结所在,但我不知道如何解决它 代码 using System; using System.Collections.Generic; using System.Text; using System.Web.UI; using System.Web; using System.Linq; namespace App.plugins { public class ThePlugin {

我有一个用C#编写的web应用程序插件。当应用程序调用它时,插件程序集无法编译

我已经找到了问题的症结所在,但我不知道如何解决它

代码

using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Web;
using System.Linq;

namespace App.plugins
{
    public class ThePlugin
    {
        public string ToHtml(){...}
    }
}
当我省略使用System.Linq的
插件已成功编译。我还检查了IIS中加载的程序集,并且列表中有
System.Core
(包含
System.Linq

编辑:

如何:

已获取:错误,这表明系统命名空间名称中不存在类型或命名空间Linq(错误号#CS0234)

框架:
.NET框架4.5


有什么提示吗?

有必要将
System.Core.dll
添加到dll列表中,如下所示

CompilerParameters cp = new CompilerParameters();
cp.ReferencedAssemblies.Add("System.Core.dll");
CompilerResults cr = provider.CompileAssemblyFromSource(cp, SourceCode);

“插件程序集无法编译”-那么出了什么问题?你观察到了什么?应用程序是如何编译插件的?您使用的是什么版本的.NET?这里缺少这么多信息。。。
CompilerParameters cp = new CompilerParameters();
cp.ReferencedAssemblies.Add("System.Core.dll");
CompilerResults cr = provider.CompileAssemblyFromSource(cp, SourceCode);