使用DNX时出现框架不兼容问题

时间:2016-01-28 13:37:43

标签: asp.net dnx

我创建了一个ASP.NET MVC 6 Web应用程序项目“OpsTools”。项目json文件是:

    {
      "webroot": "wwwroot",
      "version": "1.0.0-*",
      "dependencies": {
        "Microsoft.AspNet.Diagnostics": "1.0.0-beta6",
        "Microsoft.AspNet.Mvc": "6.0.0-beta6",
        "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta6",
        "Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
        "Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
        "Microsoft.AspNet.StaticFiles": "1.0.0-beta6",
        "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta6",
        "Microsoft.Framework.Configuration.Json": "1.0.0-beta6",
        "Microsoft.Framework.Logging": "1.0.0-beta6",
        "Microsoft.Framework.Logging.Console": "1.0.0-beta6",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta6",
        "EntityFramework": "6.1.3",
        "jqGridWebApi": "1.1.4",
        "OrionSharedObjects": "4.7.0.1",
        "EnyimMemcached": "2.13.0",
        "CouchbaseNetClient": "1.2.7",
        "xunit": "2.2.0-beta1-build3239",
        "Moq": "4.2.1510.2205"
      },
      "commands": {
        "web": "Microsoft.AspNet.Hosting --config hosting.ini"
      },
      "frameworks": {
        "dnx451": {
          "frameworkAssemblies": {
            "System.Data": "4.0.0.0"
          }
        }
      },
      "exclude": [
        "wwwroot",
        "node_modules",
        "bower_components"
      ],
      "publishExclude": [
        "node_modules",
        "bower_components",
        "**.xproj",
        "**.user",
        "**.vspscc"
      ],
      "scripts": {
        "prepublish": [ "npm install", "bower install", "gulp clean", "gulp min" ]
      },
      "configurations": {
        "Staging": { }
      }
    }

然后我在解决方案中为单元测试添加了一个新的类包库项目。我试着引用第一个项目。我发现第二个项目中的project.json是:

    {
  "version": "1.0.0-*",
  "projectUrl": "",
  "licenseUrl": "",

  "frameworks": {
    "dnx451": {
      "dependencies": {
        "OpsTools": "1.0.0-*"
      }
    },
    "dnxcore50": { }
  }
}

问题是我有很多编译错误。基本上他们是

  

找不到类型或命名空间名称'System'(您是否缺少using指令或程序集引用?)OpsTools.Test.DNX Core 5.0 C:\ Source \ Optools \ src \ OpsTools.Test \ Properties \的AssemblyInfo.cs

1 个答案:

答案 0 :(得分:0)

因为项目使用不同的框架。它们是测试版并且不稳定。很难协调它们。我只是删除了第二个项目。