如何用Nsight调试C# OpenGL程序

 
Q: I have an OpenGL application written in C#. When I try to debug the application using Nsight 4.5, I get the following error:

Launch failed : Unable to launch .\program.exe because architecture type is MSIL

This was previously possible, and now its not. Is there a way around this?
 
A: Maybe you can try this:

- build your code target x86 or x64, but not AnyCPU

This may jump over your issue, but if it still show no success, I have to say Nsight don't official support .Net codes and binary files.
 
 

转载于:https://www.cnblogs.com/lilei9110/p/4537272.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是一个简单的用C#编写的时间和气温布局图示例: ```csharp using System; using System.Windows.Forms; using System.Drawing; public class TimeAndTemperature : Form { private Label timeLabel; private Label temperatureLabel; public TimeAndTemperature() { this.Text = "时间和气温布局图"; this.Size = new Size(250, 100); // 时间标签 timeLabel = new Label(); timeLabel.Text = "当前时间:"; timeLabel.Location = new Point(10, 10); this.Controls.Add(timeLabel); // 气温标签 temperatureLabel = new Label(); temperatureLabel.Text = "当前气温:"; temperatureLabel.Location = new Point(10, 40); this.Controls.Add(temperatureLabel); // 定时器,每秒更新时间标签 Timer timer = new Timer(); timer.Interval = 1000; timer.Tick += new EventHandler(timer_Tick); timer.Start(); } // 更新时间标签 private void timer_Tick(object sender, EventArgs e) { timeLabel.Text = "当前时间:" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); } // 更新气温标签 public void UpdateTemperature(int temperature) { temperatureLabel.Text = "当前气温:" + temperature.ToString() + "℃"; } static void Main() { TimeAndTemperature form = new TimeAndTemperature(); form.UpdateTemperature(20); // 假设当前气温为20℃ Application.Run(form); } } ``` 上面的代码中,我们创建了一个 `TimeAndTemperature` 类,继承自 `Form` 类,表示我们要创建一个窗体。在窗体中,我们添加了两个 `Label` 控件,分别用于显示时间和气温。并且我们使用了一个 `Timer` 定时器,每秒钟更新一次时间标签的内容。 此外,我们还添加了一个 `UpdateTemperature` 方法,用于更新气温标签的内容。在 `Main` 方法中,我们创建了一个 `TimeAndTemperature` 实例,并调用 `UpdateTemperature` 方法来更新气温标签的内容。最后,我们调用 `Application.Run` 方法启动应用程序,显示窗体。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值