开发者

C#: how to use Microsoft.Win32.SafeHandles

开发者 https://www.devze.com 2023-01-31 16:32 出处:网络
Why does using Microsoft.Win32.SafeHandles cause the C# Compiler Error: The type or namespace name \'SafeHandles\' does not exist in the

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

精彩评论

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