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

如何從 MSBUILD 覆蓋 .NET 中引用的 CopyLocal(私有)設

How do I override CopyLocal (Private) setting for references in .NET from MSBUILD(如何從 MSBUILD 覆蓋 .NET 中引用的 CopyLocal(私有)設置)
本文介紹了如何從 MSBUILD 覆蓋 .NET 中引用的 CopyLocal(私有)設置的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我已經為此苦苦掙扎了幾天,經過大量搜索后,我找不到我應該走的路.

I have been wrestling with this for a few days and after tons of searching I can't find the path I should be on.

我想要做的是設置一個 MSBUILD 項目,它將構建我們的整個 .NET 應用程序(8 個解決方案的常量,并且可能有 250 個項目在它們之間拆分),其中一些設置從單個項目文件中覆蓋以進行自己的調試版本.

What I want to do is set up an MSBUILD project that will build our entire .NET application (constst of 8 solutions, and maybe 250 projects split up between them) with a number of settings overridden from the individual project files to make a debug build for myself.

具體來說,我想構建我們的發布配置,關閉優化并生成完整的調試信息/pdb.另外,為了減少我們目前超長的構建時間,我希望每個項目的每個引用都復制本地"(或實際項目文件 xml 中的私有)為 false.

Specifically I want to build our release configuration with optimizations off and full debug info / pdbs generated. Also, in order to reduce our currently ultra-long build time I want "copy local" (or private in the actual proj file xml) false for every reference of every project.

第一件事很簡單,我可以很容易地覆蓋項目級別的屬性(您甚至可以使用/p 從 MSBuild 命令行執行此操作),但我不知道如何覆蓋一個參考.我已經嘗試了一些我在 StackOverflow 和網絡上看到的東西,但還沒有一個解決方案.

The first things were fairly easy, I can override a project level property fairly easily (you can even do this from the MSBuild command line using /p), but what I can't figure out is how to override a property on a reference. I have tried several things I saw here on StackOverflow and around the web, but nothing is a solution yet.

我可以通過更改 Microsoft.Common.targets 來做我想做的事,注釋掉 _CopyFilesMarkedCopyLocal 目標中的代碼會完全跳過這些文件的復制.但我不想改變我的全局配置并在所有情況下都這樣做.我創建了自己的備用目標文件——如果我改變一個單獨的項目文件以指向它,它就可以工作——但我不知道如何指定它在頂層使用(我的 .proj 文件只是構建所有 8 個解決方案).如果我能以某種方式僅覆蓋頂層的 _CopyFilesMarkedCopyLocal 目標,那就太好了,這樣如果 MS 更改了默認目標文件,我的構建就不會搞砸,但我也不知道如何使它工作.

I can do what I want by altering Microsoft.Common.targets, commenting out the code in the _CopyFilesMarkedCopyLocal target completely skips the copying of these files. But I don't want to alter my global configuration and do this in all circumstances. I created my own alternate targets file -- which works if I alter an individual project file to point to it -- but I can't figure out how to specify this to be used at the top level (my .proj file that just builds all 8 solutions). It would be great if I could somehow override just the _CopyFilesMarkedCopyLocal target at the top level so that if MS changes the default targets file my build isn't screwed up, but I can't figure out how to make this work either.

如果有一種方法可以覆蓋參考級別屬性,就像您可以項目級別屬性一樣,而不必重寫/覆蓋構建目標的東西,那么最好的可能就是 - 但我沒有發現任何信息表明這是可能的.

The best possible thing would be if there was a way to just override reference level properties like you can project level properties, without having to rewrite/override the build targets stuff -- but I have found no information indicating this is possible.

提前感謝您對此提供的任何幫助.

Thanks in advance for any help on this.

附言我實際上不可能瀏覽所有項目文件并更改它們;我需要一個解決方案,讓現有代碼保持原樣.

P.S. It is not possible for me to actually just go through all the projects files and change them; I need a solution that leaves the existing code in place as is.

推薦答案

試試這個:

CustomAfterMicrosoftCommonTargets 設置為 C:foofilter.targets (或任何您命名的文件) 并將 filter.targets 設置為:

Set the CustomAfterMicrosoftCommonTargets to C:foofilter.targets (or whatever you name the file) and have filter.targets to be:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <ItemDefinitionGroup>
      <Reference>
        <Private>False</Private>
      </Reference>
    </ItemDefinitionGroup>
</Project>

這篇關于如何從 MSBUILD 覆蓋 .NET 中引用的 CopyLocal(私有)設置的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

Is there a way to know if someone has bookmarked your website?(有沒有辦法知道是否有人為您的網站添加了書簽?)
Use of Different .Net Languages?(使用不同的 .Net 語言?)
Determining an #39;active#39; user count of an ASP.NET site(確定 ASP.NET 站點的“活動用戶數)
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權列表中選擇 x 個隨機元素(無需替換))
Best way to keep track of current online users(跟蹤當前在線用戶的最佳方式)
Recommend an Open Source .NET Statistics Library(推薦一個開源的.NET統計庫)
主站蜘蛛池模板: 毛片a级毛片免费播放100 | 97久久久 | 91 在线| 91在线视频播放 | 在线观看成年视频 | 久久精品99国产精品 | 九九99精品 | 在线观看精品 | 国产一区二区三区在线看 | 99久久久久久99国产精品免 | 日日干夜夜操天天操 | 一区二区三区日本 | 日韩成人在线免费观看 | 久久久资源| 日本视频一区二区三区 | 久久免费福利 | 久久亚洲综合 | 久草视频观看 | 久久久区 | 野狼在线社区2017入口 | 无吗视频| 久久99精品久久久久久琪琪 | 精品不卡 | 亚洲精品二三区 | 久久久久久影院 | 日韩视频在线一区 | 国产一区二区免费电影 | 91精品国产91 | 欧美日韩国产一区 | 亚洲高清视频在线观看 | 四虎影院免费在线播放 | 午夜小电影 | 国产精品欧美大片 | 在线看91| 亚洲国产精品一区 | 成人久久久 | 国产精品自产拍在线观看蜜 | 国产精品一区二区三区在线播放 | www.一区二区三区 | 7777精品伊人久久精品影视 | 亚洲久久 |