久久久久久久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 的類)
主站蜘蛛池模板: 狠狠的日 | 日本一区二区三区免费观看 | 在线欧美视频 | 三级国产三级在线 | 久久国产精品一区二区三区 | av激情在线 | 99pao成人国产永久免费视频 | 久久久久久久久99精品 | av天天干 | 国产精品免费在线 | 欧美在线 | 欧美一区2区三区4区公司 | 久久国产激情视频 | 欧洲高清转码区一二区 | 国产精品视频网 | 国产精品久久久久久久久久久久久 | 精品一区二区观看 | 国产乱码精品一区二区三区中文 | 亚洲网站在线 | 久久99精品国产99久久6男男 | 免费亚洲网站 | 秋霞在线一区 | 欧美精品久久 | h片在线免费看 | 国产福利视频导航 | 国产一区免费视频 | 亚洲免费一区二区 | 欧美精品一区二区免费 | 99re视频在线观看 | 亚洲一区二区三区高清 | 国产日韩一区二区 | 日日夜夜免费精品 | 毛片一区二区 | 91久久国产综合久久 | 黄色激情毛片 | 国产aⅴ精品 | 天天曰夜夜 | 荷兰欧美一级毛片 | 伊人国产精品 | 成人毛片视频在线播放 | 91视频在线观看免费 |