gpt4 book ai didi

c# - 命名空间 system.windows 中不存在“Forms”

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

我刚刚开始使用 C#,并且正在摆弄一些我从某个论坛获得的代码示例。

此代码使用的命名空间 using system.windows.forms 我收到错误消息:

Forms does not exist in the namespace system.windows.

我还收到一些与 senddownsendup 的未定义函数相关的错误,我认为它在 Forms 命名空间中。

我正在使用 visual studio 10(带有 .net frame work 4.0)。知道如何修复此错误吗?

最佳答案

在解决方案树中展开项目,右键单击ReferencesAdd Reference,选择System.Windows.FormsFramework 选项卡上。

有时您需要添加对一些非默认程序集的引用。

来自评论:对于寻找 VS 2019+ 的人:现在添加项目引用是 Right-Click Dependencies in Solution资源管理器

对于寻找 VS Code 的人:How do I add assembly references in Visual Studio Code

关于c# - 命名空间 system.windows 中不存在“Forms”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6639468/

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