VS2022:是否有一种更快的方法来切换“启用本机代码调试”。环境?
我使用托管(C#)和本机(C ++)代码的解决方案。托管代码调用C ++。通常,我的本机代码调试禁用是因为它使整个体验较慢,但是我有很多次需要启用它。
不幸的是,该过程很麻烦:
- 右键单击项目。
- 选择“属性”。
- 选择“调试”类别。
- 单击“打开启动配置文件UI”。
- 向下滚动。
- 单击“本机代码调试”复选框。
我想让这个更快。我希望可能有一些命令可以将钥匙绑定到。 I tried going into Tools >> Customize and searching for a command that had "Native" or "Managed" in it. I didn't find anything that was like what I want.
Does anyone know a faster way to toggle this setting?
I work on a solution with both managed (C#) and native (C++) code. The managed code calls into the C++. I typically have native code debugging disabled because it makes the whole experience slower but I have many times where I need to enable it.
Unfortunately the process is cumbersome:
- Right click on project.
- Choose "Properties".
- Choose "Debug" category.
- Click "Open Launch Profiles UI".
- Scroll down.
- Click the "Native Code Debugging" checkbox.
I wanted to make this faster. I was hoping there might be some command for it that I could bind a key to. I tried going into Tools >> Customize and searching for a command that had "Native" or "Managed" in it. I didn't find anything that was like what I want.
Does anyone know a faster way to toggle this setting?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建一个
启动settings.json
文件,看起来像这样:我验证了您可以执行此操作,即使您的项目是.NET Framework;尽管您必须首先要将您的
.csproj
转换为SDK样式(如果还没有)。它应放入C#项目的属性
目录中。因此,如果您发现自己在想要的本机代码开/关之间切换,我想您可以在
aunplionSettings.json.json
文件中进行两个可执行项目,一个设置,而另一个则没有。并在启动项目之间切换。或类似的东西。You can create a
launchSettings.json
file and it would look something like this:I verified you can do this even if your project is .Net Framework; though you'll have to first you want to convert your
.csproj
over to SDK style if it isn't already. It is to be put in theProperties
directory of your C# project.So if you find yourself toggling between wanting Native Code Debugging on/off I suppose you could make two executable projects one with this setting in the
launchsSettings.json
file and the other without. And toggle between start-up projects. Or something like that.