我在使用 Visual Studio 时遇到问题。我正在运行 VS 2013 专业版并从 here 安装了 TDS(站点核心团队开发)版本 5.1.0.24 但是当我尝试在 visual studio 下创建一个新的 TDS 项目(在此捕获中名为 TDSMaster)时,我收到此错误
我正在运行 Visual Studio 2013 专业版和 Windows 7 专业版。我已经安装了一些其他版本的 VS(2012、2013、2015),但在安装 VS 2013 pro 之前卸载了它们。
有人帮忙吗?
最佳答案
我终于找到了解决方案,所以我分享它以防有一天有人遇到同样的问题。 问题是,当我出于某种原因卸载 VS 2015 社区时,它没有删除注册表中的 key ,在 VS 输出中我得到了这个异常(但它并没有在我尝试创建项目时每次都显示,只是有时)
Exception MSBuildToolsPath is not specified for the ToolsVersion "14.0" defined at "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0", or the value specified evaluates to the empty string. (InvalidToolsetDefinitionException):
at Microsoft.Build.BuildEngine.InvalidToolsetDefinitionException.Throw(Exception innerException, String resourceName, Object[] args)
at Microsoft.Build.BuildEngine.ToolsetReader.ReadToolset(PropertyDefinition toolsVersion, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties, Boolean accumulateProperties)
at Microsoft.Build.BuildEngine.ToolsetReader.ReadEachToolset(ToolsetCollection toolsets, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties, Boolean accumulateProperties)
at Microsoft.Build.BuildEngine.ToolsetReader.ReadToolsets(ToolsetCollection toolsets, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties, Boolean accumulateProperties)
at Microsoft.Build.BuildEngine.ToolsetReader.ReadAllToolsets(ToolsetCollection toolsets, ToolsetRegistryReader registryReader, ToolsetConfigurationReader configurationReader, BuildPropertyGroup globalProperties, BuildPropertyGroup initialProperties, ToolsetDefinitionLocations locations)
at Microsoft.Build.BuildEngine.Engine.PopulateToolsetStateMap(ToolsetDefinitionLocations locations)
at Microsoft.Build.BuildEngine.Engine..ctor(Int32 numberOfCpus, Boolean isChildNode, Int32 parentNodeId, String localNodeProviderParameters, BuildPropertyGroup globalProperties, ToolsetDefinitionLocations locations)
at Microsoft.Build.BuildEngine.Engine.get_GlobalEngine()
at Microsoft.VisualStudio.Package.Utilities.InitializeMsBuildEngine(Engine existingEngine, IServiceProvider serviceProvider)
at HedgehogDevelopment.SitecoreProject.VSIP.SitecoreProjectPackage.Initialize()
所以我所要做的就是按照说明删除注册表中的 key here .
我按照@Richard Seal 的建议编辑我的问题
打开注册表 (regedit)
导航到 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild(操作系统 32 位)或 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild(64 位)
在进一步备份此注册 key 之前(选择 MSBuild key ,然后选择文件 -> 导出)
展开 MSBuild 下的 ToolsVersions,你应该看到 14.0 出现在 ToolsVersions 下但没有出现在 MSBuild 下,删除这个键
如果你有 VS 正在运行,你应该重新启动它
关于c# - Visual Studio Sitecore TDS 无法打开 .scproj 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34666210/