【问题标题】:Why does Bridge.net not compile HashSet<T> or Stack<T>为什么 Bridge.net 不编译 HashSet<T> 或 Stack<T>
【发布时间】:2021-02-08 02:12:54
【问题描述】:

我使用的是 Bridge.net v17.10.1,根据文档,它们是在 Bridge.Core 中实现的。

HashSet<T> varName;
Stack<T> varName2;

产生以下错误:

Error   CS0433  The type 'HashSet<T>' exists in both 'System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'Bridge, Version=17.6.0.0, Culture=neutral, PublicKeyToken=null'


Error   CS0433  The type 'Stack<T>' exists in both 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'Bridge, Version=17.6.0.0, Culture=neutral, PublicKeyToken=null' 

可能是一些超级简单的事情,但是我的 Bridge.Net 知识有限,我一直无法弄清楚。

【问题讨论】:

    标签: c# bridge.net


    【解决方案1】:

    这是一个已知问题,这里描述了答案:https://forums.bridge.net/forum/community/help/2902-c-compile-error-the-type-stopwatch-exists-in-both-system-and-bridge

    是的,您必须从您的 csproj 文件中删除系统引用 另外我可以建议添加以下引用以防止 Visual Studio 添加系统引用

    <Reference Include="System" Condition="False" />
    

    【讨论】:

    • Bridge.HashSet 不正确。类是 System.Collections.Generic.HashSet。看看 Bridge.Net 是什么。 is不是一个简单的类库,而是一种将c#编译成javascript的方法。意图是使用原始的HashSet类
    • 我想通了。您需要使用论坛描述的解决方法
    猜你喜欢
    • 1970-01-01
    • 2015-07-23
    • 2012-08-04
    • 2011-06-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-03-01
    相关资源
    最近更新 更多