c# - 从csproj中的一个项目生成两个dll

标签 c# msbuild csproj csc

我需要一个项目中的两个 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" />

最佳答案

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

关于c# - 从csproj中的一个项目生成两个dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25033760/

相关文章:

c# - Serilog - ForContext 将字典值视为复杂对象

c# - 如何远程调试数据库的 ASP.NET MVC bug?

visual-studio - MSBuild 无法使用复制任务递归复制文件

nuget - 使用 nuget 包转换 .csproj

msbuild - 如何在 Visual Studio 2017 为我创建的 NuGet 包中包含我的类库旁边的文本文件?

c# - 为什么 Application Insights 将 Nlog Error 写入 Trace 而不是异常?

msbuild - MSBuild 如何检查目标是否是最新的?

.net - 在 Visual Studio 中抑制 tlbimp 警告

c# - datagridview 文本框中的列总和