【发布时间】:2015-06-29 17:05:50
【问题描述】:
我创建了一个 Visual Studio 2015 RC 解决方案,如下所示:
Project
global.json
Source
MvcProject
MvcProject.Test
MvcProject.Test 是一个类库,我在其中创建了一个测试。
global.json 文件有以下内容:
{
"projects": [ "Source" ],
"sdk": {
"version": "1.0.0-beta4"
}
}
而 MvcProject.Test 中的 project.json 是:
{
"compilationOptions": {
"warningsAsErrors": true
},
"dependencies": {
"Microsoft.AspNet.Mvc": "6.0.0-*",
"xunit.runner.aspnet": "2.0.0-aspnet-*"
},
"commands": {
"test": "xunit.runner.aspnet"
},
"frameworks": {
"dnx451": {
"dependencies": {
"Moq": "4.2.1506.2016"
}
}
}
}
然后我创建了一个简单的测试:
using Xunit;
namespace MvcProject.Test {
public class FirstTests {
[Fact]
public void HelloTest() {
Assert.Equal(2, 2);
}
}
}
当我构建 solition 时出现错误:
The type or namespace name 'Fact' could not be found (are you missing a using directive or an assembly reference?) MvcProject.Test.DNX 4.5.1
The name 'Assert' does not exist in the current context Bityond.Test.DNX 4.5.1
我的配置中缺少什么?
【问题讨论】:
标签: asp.net-mvc visual-studio-2015 asp.net-core-mvc