Jen*_*sen 7 msbuild csproj visual-studio-debugging visual-studio-2012
我有一个问题,我的vshost.exe文件名与我的实际application.exe文件名不同,阻止我调试应用程序.
设置如下:
- MySolution
    - Installer.Release
    - Installer.Debug
    - Installer.Testing
    - MyApplication
我正在使用Visual Studio 2012,.NET 4.0和InstallShield LE.
现在,我无法控制的原因,它决定了应用程序的可执行文件名称应包含环境:MyApplication (Release).exe,MyApplication (Debug).exe,MyApplication (Testing).exe.
通过将.csproj文件修改为以下内容可以轻松完成此操作:
<AssemblyName>MyApplication (Release)</AssemblyName>
<AssemblyName Condition="'$(Configuration)' == 'Debug'">MyApplication (Debug)</assemblyName>
<AssemblyName Condition="'$(Configuration)' == 'Testing'">MyApplication (Testing)</AssemblyName>
在其中构建应用程序时Debug,在我的bin/Debug文件夹中生成以下文件:
MyApplication (Debug).exe
MyApplication (Debug).exe.config
MyApplication (Debug).vshost.exe
MyApplication (Debug).vshost.manifest
到现在为止还挺好.
在构建应用程序时Testing,它会在我的bin/Testing文件夹中生成以下文件:
MyApplication (Testing).exe
MyApplication (Testing).exe.config
MyApplication (Debug).vshost.exe
MyApplication (Debug).vshost.manifest
如您所见,生成的vshost文件的命名方式不同,这会导致Visual Studio在尝试调试时抛出以下错误:
Visual Studio无法启动调试,因为缺少调试目标"D:\ Code\MySolution\MyApplication\bin\Testing\MyApplication(Debug).exe".请构建项目并重试,或者相应地设置OutputPath和AssemblyName属性以指向目标程序集的正确位置.
有趣的是,如果我AssemblyName将Debug配置更改为MyApplication (Foo),则文件Testing夹中的vhost文件也会重命名为MyApplication (Foo).所以有些东西迫使我的Debug配置用于我的Testing配置.但是什么?
目前我可以通过启动应用程序然后附加Visual Studio调试器来解决它,但它浪费了我的时间.构建安装程序时也不是问题,因为简单地忽略了vshost文件.
到目前为止,谷歌并没有真正的帮助.大多数搜索结果都解释了什么是vshost文件以及它是如何工作的,但这不是我需要的.我需要知道为什么vshost文件的命名方式不同以及如何解决这个问题.
| 归档时间: | 
 | 
| 查看次数: | 615 次 | 
| 最近记录: |