简体   繁体   English

Visual Studio构建,但msbuild不构建。

[英]Visual studio builds but msbuild does not.

I have looked at many of the similar questions, none have answered my problem thus far. 我看过许多类似的问题,到目前为止,还没有一个问题能回答我的问题。

I can't build any of the libraries/applications in the project with msbuild. 我无法使用msbuild构建项目中的任何库/应用程序。 There are 0 errors, 0 warnings, 0 messages in visual studio. 在Visual Studio中,有0个错误,0个警告和0条消息。

Even when I isolate the library, none of them compile. 即使我隔离了库,也没有一个可以编译。 There are 68 errors for the core library that is not dependant on anything except two nuget packages. 核心库有68个错误,除了两个nuget包以外,其他任何都不依赖。 Some of the errors include: 一些错误包括:

CS1003 Syntax error, "," expected and CS1525 Invalid expression term 'double' . CS1003语法错误“,”,以及CS1525无效的表达式术语“ double” Both On a line like this: Function(param1, param2, out double bla, out double blu); 两者都在这样的一行上: Function(param1, param2, out double bla, out double blu);

CS1003 Syntax error, '[' expected on a line like this: void FuncPointer() { Obj.Function(); } CS1003语法错误,“ [”应在这样的行上出现: void FuncPointer() { Obj.Function(); } void FuncPointer() { Obj.Function(); }

And many other obviously wrong errors but not on every line. 还有许多其他明显错误的错误,但并非每一行都如此。 Mostly "," expected errors. 通常为“,”预期错误。

Turns out, that something had caused Illegal characters in a Nuget.config file in AppData. 事实证明,某些原因导致AppData的Nuget.config文件中出现非法字符。 But the project was still getting compiled into a nuget package in visual studio, which is why this went unnoticed. 但是该项目仍在Visual Studio中被编译为一个nuget包,这就是为什么它没有引起注意的原因。 All the packages were already installed. 所有软件包都已安装。 I introduced a local nuget.config in the repo to prevent that error, and the rest of the build was fine in msbuild.exe. 我在存储库中引入了本地nuget.config来防止该错误,其余的构建在msbuild.exe中都可以。

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

相关问题 MsBuild以与Visual Studio 2015不同的顺序生成项目,但失败 - MsBuild builds projects in different order to Visual Studio 2015, and fails Visual Studio生成解决方案,但命令行中的MSBuild失败 - Visual Studio builds solution but MSBuild from the command line fails 奇怪的MsBuild错误(在Visual Studio中一切正常) - Strange MsBuild Error (Everything builds fine in Visual Studio) 配置 MSBuild.exe cli 构建以增量运行,就像在 Visual Studio 构建中一样 - Configure MSBuild.exe cli builds to run incrementally like in Visual Studio builds Visual Studio 2015可以毫无问题地构建我的项目,MSBuild.exe无法 - Visual Studio 2015 builds my project without problems, MSBuild.exe cannot 为什么我的解决方案在Visual Studio中构建,而不是使用msbuild从命令行构建? - How come my solution builds in Visual Studio but not from the command line using msbuild? 如何加快Visual Studio构建以匹配MSBuild并行性能? - How can I speed up Visual Studio builds to match MSBuild parallel performance? 在Visual Studio 2010中按F5构建但不启动应用程序 - Pressing F5 in Visual Studio 2010 Builds but does not Launch Application Visual Studio如何确定是否必须启动MSBuild? - How does Visual Studio determine whether it has to start MSBuild or not? MsBuild 在 Visual Studio Online 上找不到已恢复的 NuGet 包 - MsBuild does not find restored NuGet-Packages on Visual Studio Online
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM