在 Debug模式下运行应用程序时, list 不强制Visual Studio 2013在管理员下重新启动

标签 manifest visual-studio-2013

这在VS2010和VS2012中起作用。但是在VS2013应用程序中(通过按“运行”或F5键)只是从我的用户权限开始,并且无法访问某些资源(我正在使用HttpListener)。

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

我尝试使用google,尝试生成新的 list ,从MSDN复制了它的内容,但没有任何帮助。 VS2013的这一部分是否发生了变化?

Update1:​​
那是一部分。这是完整的 list 内容:
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
  <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
  </requestedPrivileges>
</security>
</trustInfo>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
  <application></application>
</compatibility>

</asmv1:assembly>

Update2:
Okey这里是一个简单的示例:运行编译的.exe文件时,UAC会要求管理员特权。但是,当我从VS2013运行它时(通过按“运行”或F5键)却没有!而且,如果您使用VS2012/VS2010打开同一项目,则他们确实要求在admin下重新启动。
您可以快速检查以下内容:
在VS2013中创建控制台应用程序,添加 list 并设置 level =“requireAdministrator” 。然后运行或按F5(在按Ctrl-F5时,VS2013在admin下运行该应用程序)。
但这不是VS2012/VS2010的行为!
我们如何获得旧的行为?

Update3:
请投票给here或通知我有关另一张票的信息。

最佳答案

您需要禁用托管进程选项以获取VS重新启动提示。在“项目+属性”的“调试”选项卡上,取消选中“启用Visual Studio托管过程”复选框。立即启动VS高架会更容易。右键单击快捷方式,以管理员身份运行。

不能完全确定这是错误还是功能。请随时关注this Connect report以了解更多信息。

更新:看起来像个错误,反馈报告已关闭为“已修复”。不幸的是,它没有给出何时将该修补程序制作成我们的机器的提示。也许是VS2013的 future 更新,肯定是下一版本。
Update2:该修复程序已纳入VS2013 Update 3。

关于在 Debug模式下运行应用程序时, list 不强制Visual Studio 2013在管理员下重新启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19692516/

相关文章:

java - 直接在Eclipse中运行源代码即可。为什么 Jar 文件将停止运行并且控制台中没有异常显示?

json - href 链接的 Google Chrome 主题颜色悬停

class - 在 ANT 中制作 JAR 时如何有条件地包含 list 选项

c++ - 在 std::map 中使用 std::function

sql-server - 无法在 Visual Studio 2012 或 2013 中打开 SSIS 项目(迁移失败)

windows - 如何从 Qt 生成带有应用程序 list 的 Visual Studio 项目?

java - 在 ant build 中包含 hibernate jar 依赖项

c# - EF6 DbContext IOC 依赖

c# - 尝试从转储文件中调试 Windows Store App

javascript - Visual Studio 2013 JSLint 验证?