gpt4 book ai didi

由于 System.Web 冲突,C# .NET DLL 无法构建

转载 作者:太空狗 更新时间:2023-10-29 20:11:41 27 4
gpt4 key购买 nike

我在 Visual Studio C# Express 2010 中的类库有问题。该项目配置了 .NET 4.0 的目标框架(不是客户端配置文件)。

在我的类库中,我添加了对 System.Web 的引用以使 URL 编码适用于我的 oAuth 库。

在构建 DLL 和关联的测试应用程序时,出现以下错误:

Error   1   The type or namespace name 'TwitterAPI' could not be found (are you missing a using directive or an assembly reference?)    C:\Users\sammarks\Documents\Programming\Twitter.NET\Tester\Program.cs   5   7   Tester

而且,我收到以下警告消息:

Warning 2   The referenced assembly "C:\Users\sammarks\Documents\Programming\Twitter.NET\TwitterAPI\bin\Release\TwitterAPI.dll" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". Please remove references to assemblies not in the targeted framework or consider retargeting your project.   Tester

我不确定它为什么这样做,但这就是我来到这里的原因。我已经尝试将类库重新定位到 3.5,但这只会让事情变得更糟。

我也曾尝试将 System.Web 重新添加到引用中,但这也无济于事。

有什么建议吗?

最佳答案

完整 .NET Framework 4.0 为目标以访问 System.Web(不是客户端配置文件):

enter image description here

关于由于 System.Web 冲突,C# .NET DLL 无法构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4868388/

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