C# 为什么这不是编译

C# 为什么这不是编译,c#,C#,我有一个我需要的库,它是用c编写的: 我已经阅读了一些基本的c文档如何编译,以及微软网站上的主要术语 我已安装以下visual studio和以下生成工具: 我已下载源代码,并已从命令行运行命令: MSBuild.exe [mydirectory]/jsxbin_to_jsx.sln 但我得到以下错误: 或以文本形式: "C:\Program Files (x86)\MSBuild\14.0\Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.sl

我有一个我需要的库,它是用c编写的:

我已经阅读了一些基本的c文档如何编译,以及微软网站上的主要术语

我已安装以下visual studio和以下生成工具:

我已下载源代码,并已从命令行运行命令:

MSBuild.exe [mydirectory]/jsxbin_to_jsx.sln
但我得到以下错误:

或以文本形式:

"C:\Program Files (x86)\MSBuild\14.0\Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.sln" (default target) (1) ->
"C:\Program Files (x86)\MSBuild\14.0\Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.Tests\jsxbin_to_jsx.Tests.csproj" (default target) (3) ->
(CoreCompile target) ->
  JsxbinToJsxTests.cs(2,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\Program Files (x86)\MSBui
ld\14.0\Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.Tests\jsxbin_to_jsx.Tests.csproj]
  JsxbinToJsxTests.cs(6,6): error CS0246: The type or namespace name 'TestClassAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Program Files (x86)\MSBu
ild\14.0\Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.Tests\jsxbin_to_jsx.Tests.csproj]
  JsxbinToJsxTests.cs(6,6): error CS0246: The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?) [C:\Program Files (x86)\MSBuild\14.0\
Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.Tests\jsxbin_to_jsx.Tests.csproj]
  JsxbinToJsxTests.cs(9,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Program Files (x86)\MS
Build\14.0\Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.Tests\jsxbin_to_jsx.Tests.csproj]
  JsxbinToJsxTests.cs(9,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Program Files (x86)\MSBuild\14.
0\Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.Tests\jsxbin_to_jsx.Tests.csproj]
  JsxbinToJsxTests.cs(15,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Program Files (x86)\M
SBuild\14.0\Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.Tests\jsxbin_to_jsx.Tests.csproj]
  JsxbinToJsxTests.cs(15,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Program Files (x86)\MSBuild\14
.0\Bin\jsxbin-to-jsx-converter-master\jsxbin_to_jsx.Tests\jsxbin_to_jsx.Tests.csproj]

通过谷歌搜索错误,我尝试在project.cs文件中使用using关键字添加单元测试库,但仍然不起作用。我试过其他一些方法,但都没能成功

要进行快速测试,您可以下载visual studio 2013/2015来试用此解决方案


因为我只是浏览了一下文档,发现最后一次提交大约是3年前。您可以尝试使用旧版本而不是新版本

我刚刚在Visual Studio 2015中克隆了它,它构建起来没有问题。如果您没有Visual Studio的许可证,请尝试下载试用版或社区版,并按照Kira的建议进行快速测试。

只需双击解决方案文件jsxbin_to_jsx.sln即可在Visual Studio中打开它。然后转到Build->Build Solution.

是否已还原项目的NuGet软件包?您的package.config中是否引用了Microsoft.VisualStudio.QualityTools.UnitTestFramework nuget软件包?我感觉这与您使用的visual studio的社区添加有关。我从未使用过2017社区,但以前的版本对单元测试的支持有限或没有。您需要运行测试吗?如果没有,您应该能够直接构建项目。在VisualStudio中打开解决方案,右键单击jsxbin_to_jsx项目并单击build。查看是否仍然出现错误。@JonathonChase项目中根本没有package.config:D请参阅git不包含文本图像。这是不可能读的。而是复制并粘贴文本。