gpt4 book ai didi

c# - 为什么我会收到错误 "Unsafe code may only appear if compiling with/unsafe"?

转载 作者:IT王子 更新时间:2023-10-29 03:33:01 29 4
gpt4 key购买 nike

为什么会出现以下错误?

Unsafe code may only appear if compiling with /unsafe"?

我使用 C# 和 Visual Studio 2008 在 Windows CE 上进行编程。

最佳答案

要使用不安全的代码块,必须在打开/unsafe 开关的情况下编译项目。

打开项目的属性,转到Build 选项卡并选中Allow unsafe code 复选框。

关于c# - 为什么我会收到错误 "Unsafe code may only appear if compiling with/unsafe"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2026410/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com