开发者

C#: how to use Microsoft.Win32.SafeHandles

Why does using Microsoft.Win32.SafeHandles cause the C# Compiler Error:

The type or namespace name 'SafeHandles' does not exist in the namespace 'Microsoft.W开发者_开发知识库in32'

This code is lifted from http://zachsaw.blogspot.com/2010/07/serialport-ioexception-workaround-in-c.html


The problem is that you're trying to use sample code written for the normal .Net Framework in a Compact Framework project. This class is not supported by the CF.


If you want to use a SafeHandle in the Compact Framework, the SDF does include one.


There's no SafeHandles in CF. Check out OpenNetCF

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜