gpt4 book ai didi

c# - Visual Studio 中的程序集引用问题

转载 作者:太空狗 更新时间:2023-10-29 22:17:23 27 4
gpt4 key购买 nike

我在 visual studio proj2 中创建了一个新项目,我希望它具有与 proj1 相同的程序集引用,因此我打开 proj1.csproj 并复制:

<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="system" />
<Reference Include="System.Windows" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="System.Net" />
<Reference Include="System.Windows.Browser" />
</ItemGroup>

并将其粘贴到 proj1.csproj 中。问题是我的 System.Windows 程序集引用旁边有一个感叹号,当我尝试单击它时,它显示:

This project cannot be viewed in the object browser because it is unavailable or not yet built. Please ensure that the project is available and built.

当然在我的 .cs 文件中,它说

The type or namespace 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)

如何让我的程序集引用起作用?

最佳答案

转到项目属性并确保您至少以 Framework 3.0 为目标。

关于c# - Visual Studio 中的程序集引用问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5096080/

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