简体   繁体   English

System.CodeDom.Compiler作为nuget-package

[英]System.CodeDom.Compiler as nuget-package

The whole day I've been seaching for the System.CodeDom.Compiler - namespace in nuget-packages. 我整天都在寻找System.CodeDom.Compiler -nuget-packages中的命名空间。 I only found the Microsoft.CodeDom.Providers.DotNetCompilerPlatform (Roslyn ?) but it seems as the namespace I'm searching for is not included. 我只找到了Microsoft.CodeDom.Providers.DotNetCompilerPlatform (Roslyn吗?),但似乎不包含我要搜索的名称空间。 Does anyone know if there's a package containing that namespace? 有谁知道是否有包含该名称空间的软件包?

Edit: This is the code I got for now. 编辑:这是我现在得到的代码。 But Visual Studio 2015 cannot find the CodeDom in namespace System 但是Visual Studio 2015在命名空间System找不到CodeDom

using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace ICA.CubeSeven.Dynamic
{

    public class Class1
    {
    }

}

It's not in a package, it's in System.dll and is part of the framework. 它不在软件包中,而在System.dll并且是框架的一部分。

Just make sure you have using System.CodeDom.Compiler; 只要确保您已经using System.CodeDom.Compiler; in your file. 在您的文件中。

Soo I found the problem myself... In the project.json we need to add a targetframework. 如此我自己发现了问题...在project.json中,我们需要添加一个targetframework。 For me it was adding the framework-section in project.json (for default the template doesnot add a framework): 对我来说,它是在project.json中添加framework-section(默认情况下,模板不会添加框架):

{
      "frameworks": {
        "dnx451": { }
      }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM