【问题标题】:Generating two dlls from one project in csproj在 csproj 中从一个项目生成两个 dll
【发布时间】:2014-07-30 09:51:29
【问题描述】:

我需要来自一个项目的两个 dll General.BL 和 General.UI。 我在 General.UI.dll 上遇到错误。错误是:找不到类型或命名空间名称“Window”(您是否缺少 using 指令或程序集引用?)

<Target Name="General">
<Csc Condition="%(Compile.CodeType) == 'BL'" Sources="%(Compile.FullPath)" TargetType="library" OutputAssembly="$(OutputPath)General.BL.dll" EmitDebugInformation="true" AdditionalLibPaths="$(OutputPath)" 
References="MyDll.dll"/>

<Csc Condition="%(Compile.CodeType) == 'UI'" Sources="%(Compile.FullPath)" TargetType="library" OutputAssembly="$(OutputPath)General.UI.dll"
     EmitDebugInformation="true"   References="mscorlib.dll;System.dll;System.Core.dll;System.Data.Linq.dll;System.Xml.dll;Microsoft.CSharp.dll;System.Configuration.dll" />

【问题讨论】:

  • 您的用户界面使用什么技术? Winforms还是WPF?我认为,您只是不使用 Window 类引用 dll(等用于 WPF 的 PresentationFramework.dll)
  • 请查看类似的帖子 [此处][1]。 [1]:stackoverflow.com/questions/3867113/… 问候,桑迪普
  • 感谢我检查了类似帖子但无法解决问题的答案。我正在使用 WPF。如果我引用 PresentationFramework.dll 它找不到这个 dll

标签: c# msbuild csproj csc


【解决方案1】:

您没有引用System.Windows.Forms,因此它无法找到任何Window 派生词。 尝试将其添加到参考列表中,或完全删除自定义参考列表。

【讨论】:

    猜你喜欢
    • 2011-09-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-12-30
    相关资源
    最近更新 更多