久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Visual Studio 項目:如何僅包含一種配置的參考?

Visual Studio Project: How to include a reference for one configuration only?(Visual Studio 項目:如何僅包含一種配置的參考?)
本文介紹了Visual Studio 項目:如何僅包含一種配置的參考?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

環境:VS2008 C# 項目

Env.: VS2008 C# project

我需要構建我的應用程序以在 2 個不同的環境中使用.在其中一種環境中,我需要使用第 3 方 DLL 程序集.

I need to build my app for use in 2 different environments. In one of those environments, I need to use a 3rd party DLL assembly.

我可以使用#if 塊隔離使用此 DLL 的代碼.但是如何有條件地在 CS 項目文件中包含對 DLL 的引用呢?

I could isolate the code that uses this DLL using #if blocks. But how do I conditionally include the reference to the DLL in the CS project file?

womp 在他的評論中有一個很好的觀點.我變成了一個單獨的問題:如果從未調用過引用的DLL,它會被加載嗎?TIA,

womp has a good point in his comment. I turned into a separate question: Will the referenced DLL be loaded at all if it's never called? TIA,

推薦答案

卸載項目并以.XML格式打開

Unload the project and open it as .XML

找到引用項標簽并添加條件屬性.

Locate the reference item tag and add a Condition attribute.

例如:

<ItemGroup>
  <Reference Include="System.Core">
    <RequiredTargetFramework>3.5</RequiredTargetFramework>
  </Reference>
  <Reference Include="System.Data" />
  <Reference Include="System.Drawing" />
  <Reference Include="System.Xml" />

  <Reference Include="MyUtilities.Debug"
    Condition="'$(Configuration)'=='Debug'"/>

</ItemGroup>

注意最后一個引用現在有一個條件.

Notice the last reference now has a condition.

這篇關于Visual Studio 項目:如何僅包含一種配置的參考?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Is there a C# library that will perform the Excel NORMINV function?(是否有執行 Excel NORMINV 函數的 C# 庫?)
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權列表中選擇 x 個隨機元素(無需替換))
Create a summary description of a schedule given a list of shifts(給定輪班列表,創建時間表的摘要描述)
C# Normal Random Number(C# 普通隨機數)
Standard deviation of generic list?(通用列表的標準偏差?)
AsyncCTP: Creating a class that is IAwaitable(AsyncCTP:創建一個 IAwaitable 的類)
主站蜘蛛池模板: 一区二区三区四区国产 | wwwww在线观看 | 成人av免费网站 | 欧美精品成人一区二区三区四区 | 国产日韩欧美另类 | 美女黄网站 | 国产成人综合在线 | 久久国产精品99久久久大便 | 波多野结衣一二三区 | 国产一级特黄aaa大片评分 | 中文字幕91av | 欧美一区二区三区久久精品 | 国产一二三区精品视频 | 超碰8| 91久久精品日日躁夜夜躁国产 | 色欧美综合 | 久久久精品网站 | 黄片毛片在线观看 | 国产99精品 | 青青久久久| 一级黄色影片在线观看 | 国产一区二区三区色淫影院 | 国产精品久久久久久久7电影 | 亚洲一区 | 欧美成人影院在线 | 亚洲欧美在线观看 | 久草视频网站 | 亚洲电影一区二区三区 | 亚洲性视频网站 | 中文字幕一区二区三区乱码图片 | 免费a级毛片在线播放 | 中文一区二区 | caoporn免费在线视频 | 精品美女在线观看 | 丝袜天堂| 日日天天 | 精品久久一区二区 | 亚洲国产精品自拍 | www.狠狠干 | 特级做a爰片毛片免费看108 | 97视频网站 |