gpt4 book ai didi

msbuild - 无效的静态方法调用语法 : "[MSBuild]::IsRunningFromVisualStudio()"

转载 作者:行者123 更新时间:2023-12-03 11:27:58 27 4
gpt4 key购买 nike

升级到 Visual Studio 2017 15.5 后,我的项目都不会正确加载。所有都标记为不可用。

对于每个项目,我都收到以下错误:

error : Invalid static method invocation syntax: "[MSBuild]::IsRunningFromVisualStudio()". Method '[MSBuild]::IsRunningFromVisualStudio' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(a, b)). C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets



重新加载项目产生这个错误提示:
enter image description here

添加新项目会产生此错误提示:

enter image description here

最佳答案

1. 关闭所有正在运行的 Visual Studio 2017 实例

2. 启动(以管理员身份)“VS 2017 的开发人员命令提示符”

3. 键入以下命令(将 Professional 替换为您的版本,Enterprise 或 Community,或相应地调整路径):

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Build.Framework.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Build.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Build.Engine.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Build.Conversion.Core.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Build.Tasks.Core.dll"

gacutil /i "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Build.Utilities.Core.dll"

4. 重新启动 Visual Studio 2017

关于msbuild - 无效的静态方法调用语法 : "[MSBuild]::IsRunningFromVisualStudio()",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47670576/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com