编写在虚拟机(VMWare 或 Hyper-V)上运行的 .NET Framework 应用程序时需要考虑哪些因素
我的问题有点笼统。我不介意一个笼统但实用的答案。我在这里寻找与如何处理线程和线程同步相关的内容,但是,我对与在 VM 上运行 .NET 应用程序相关的任何内容感兴趣。
是否应该对事物进行不同的编码?我们是否必须在某些领域采取额外的预防措施?
谢谢
My question is somewhat general. I don't mind a general but practical answer. I am fishing here for something related to how to handle threads and thread synchronization, however, i am interested in the bigger picture of anything related to running a .NET application on a VM.
Should things be coded differently? Do we have to take extra precautions in certain areas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为虚拟机的全部意义在于,您不必担心您正在虚拟机上运行这一事实,除非您确实需要在程序中访问硬件(这对于 .网)。
您唯一关心的情况是您是否需要查询驱动器的 SMART 数据,并且需要物理访问,在这种情况下,您必须以某种方式向 VM 或 VMM 寻求帮助。
您可能需要硬件级访问的另一个例子是,当您正在编写一个旨在对设备进行基准测试的程序时(这对于 .NET 来说不太可能),因此您可能需要可以获得的原始能力(例如WinSAT 如何不在 VHD 上运行)。但这些情况不太可能发生,我怀疑您会遇到它们。
I think the entire point of virtual machines is that you don't have to worry about the fact that you're running on one, unless you literally need hardware access in your programs (which is unlikely for .NET).
The only time you would care is if you needed, say, to query SMART data for a drive, and you needed physical access, in which case you'd have to somehow ask for help from the VM or VMM.
Another example of when you might need hardware-level access is when you're writing a program that's meant to benchmark a device (which, again, is unlikely for .NET), and so you might need the raw power you can get (like how WinSAT doesn't run on a VHD). But these are unlikely scenarios and I doubt you'll run across them.