Visual Studio 2013 高 DPI 解决方法导致调试器失败

Visual Studio 2013 High DPI workaround causes debugger to fail

与这个问题 Visual Studio 2013 High DPI on 4k Screen 类似,我已经发布了一个答案,但自发现以下问题后现已删除。

我也刚买了一台新的 4K 笔记本电脑,在 SSIS 包设计器的显示和 VS2013 中的对话框以及 SSMS 中的对话框等方面一直遇到高 DPI 问题。

我为 SSMS 找到的解决方法是启用位图缩放并创建一个清单文件 - ssms.exe.manifest - 在与 ssms.exe.

相同的文件夹中

本文介绍了如何为 SSMS 修复此问题

http://www.sqlservercentral.com/blogs/spaghettidba/2015/10/14/ssms-in-high-dpi-displays-how-to-stop-the-madness/

为了完整起见,我复制了文章中描述的过程。

设置此注册表项:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide]
"PreferExternalManifest"=dword:00000001

然后将此 xml 粘贴到清单文件中。

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">

<dependency>
  <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<dependency>
  <dependentAssembly>
    <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
    </requestedPrivileges>
  </security>
</trustInfo>

<asmv3:application>
  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
    <ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</ms_windowsSettings:dpiAware>
  </asmv3:windowsSettings>
</asmv3:application>

</assembly>

现在这对 SSMS 非常有效(到目前为止),所以我尝试将此修复程序应用到 VS2013。虽然它确实修复了 SSIS 设计器显示问题,但在尝试启动调试器时会导致问题。此外,这会影响调试其他项目类型 - C#、VB 以及 SSIS 项目。

我猜清单中的依赖项不完整或不准确,因为 0x80040155 是一个未注册的 COM 接口错误代码。

Unable to start debugging.

An error occurred that usually indicates a corrupt installation (code 0x80040155). If the problem persists, repair your Visual Studio installation via 'Add or Remove Programs' in Control Panel. (Microsoft Visual Studio Debugger)

Unable to start debugging.
The debugger is not properly installed.
Run setup to install or repair the debugger. (Microsoft.DataTransformationServices.VsIntegration)

------------------------------
Program Location:

   at Microsoft.DataTransformationServices.Project.DataTransformationsPackageDebugger.LaunchVsDebugger(IVsDebugger iVsDebugger, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DataTransformationsPackageDebugger.ValidateAndRunDebugger(Int32 flags, IOutputWindow outputWindow, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.LaunchDtsPackage(Int32 launchOptions, ProjectItem startupProjItem, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.LaunchActivePackage(Int32 launchOptions)
   at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.LaunchDtsPackage(Int32 launchOptions, DataTransformationsProjectConfigurationOptions options)
   at Microsoft.DataTransformationServices.Project.DataTransformationsProjectDebugger.Launch(Int32 launchOptions, DataTransformationsProjectConfigurationOptions options)

===================================

所以我的问题是任何人都可以建议适合 VS2013 的清单(或使 SSIS 设计器行为的其他方式)吗?

好吧,所以我绝对不知道我在做什么。

但是,在与 devenv.exe (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE) 相同的文件夹中,还有几个其他清单文件,其中之一用于 DebuggerProxy.dll.manifest。由于这是一个调试器问题并且似乎缺少对调试器的引用,我将内容合并到 devenv.exe.manifest 文件中并提出了这个,这对我有用:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">

<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.Windows.Common-Controls"
      version="6.0.0.0" processorArchitecture="*"
      publicKeyToken="6595b64144ccf1df"
      language="*">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.VC90.CRT"
      version="9.0.21022.8"
      processorArchitecture="amd64"
      publicKeyToken="1fc8b3b9a1e18e3b">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel
        level="asInvoker"
        uiAccess="false"/>
    </requestedPrivileges>
  </security>
</trustInfo>

<asmv3:application>
  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
    <ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</ms_windowsSettings:dpiAware>
  </asmv3:windowsSettings>
</asmv3:application>
<file name="debuggerproxy.dll">
    <comClass clsid="{C5621364-87CC-4731-8947-929CAE75323E}" threadingModel="Both"/>
</file>
  <comInterfaceExternalProxyStub name="CausalityInternal_IAD7ALCausalityEventBridge" iid="{F6A124D7-5BB7-47B2-A9AF-AAB0EEAB60E3}" numMethods="5" proxyStubClsid32="{C5621364-87CC-4731-8947-929CAE75323E}"/>
  <comInterfaceExternalProxyStub name="CausalityInternal_ISDMCausalityEventCallback" iid="{74D108F1-1FD2-4699-991E-C4BAD52E773D}" numMethods="4" proxyStubClsid32="{C5621364-87CC-4731-8947-929CAE75323E}"/>
... many more entries ...
</assembly>

不幸的是,post 的字符数有 30k 的限制,它放不下,所以我在我的一个驱动器 here 中复制了一份文件 here