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

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

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

問題描述

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

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.

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

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.

具體來說,我想構(gòu)建我們的發(fā)布配置,關(guān)閉優(yōu)化并生成完整的調(diào)試信息/pdb.另外,為了減少我們目前超長的構(gòu)建時間,我希望每個項目的每個引用都復(fù)制本地"(或?qū)嶋H項目文件 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 命令行執(zhí)行此操作),但我不知道如何覆蓋一個參考.我已經(jīng)嘗試了一些我在 StackOverflow 和網(wǎng)絡(luò)上看到的東西,但還沒有一個解決方案.

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 目標中的代碼會完全跳過這些文件的復(fù)制.但我不想改變我的全局配置并在所有情況下都這樣做.我創(chuàng)建了自己的備用目標文件——如果我改變一個單獨的項目文件以指向它,它就可以工作——但我不知道如何指定它在頂層使用(我的 .proj 文件只是構(gòu)建所有 8 個解決方案).如果我能以某種方式僅覆蓋頂層的 _CopyFilesMarkedCopyLocal 目標,那就太好了,這樣如果 MS 更改了默認目標文件,我的構(gòu)建就不會搞砸,但我也不知道如何使它工作.

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.

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

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.

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

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 設(shè)置為 C:foofilter.targets (或任何您命名的文件) 并將 filter.targets 設(shè)置為:

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>

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

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

相關(guān)文檔推薦

Is there a way to know if someone has bookmarked your website?(有沒有辦法知道是否有人為您的網(wǎng)站添加了書簽?)
Use of Different .Net Languages?(使用不同的 .Net 語言?)
Determining an #39;active#39; user count of an ASP.NET site(確定 ASP.NET 站點的“活動用戶數(shù))
Select x random elements from a weighted list in C# (without replacement)(從 C# 中的加權(quán)列表中選擇 x 個隨機元素(無需替換))
Best way to keep track of current online users(跟蹤當(dāng)前在線用戶的最佳方式)
Recommend an Open Source .NET Statistics Library(推薦一個開源的.NET統(tǒng)計庫)
主站蜘蛛池模板: 亚洲国产成人精品久久 | 九九热精 | 98成人网 | 久久综合狠狠综合久久 | 一级欧美一级日韩片 | 伊人久久精品一区二区三区 | 成人欧美一区二区三区在线播放 | 欧美日韩久久精品 | 国产精品一区二区久久 | 欧美性生活一区二区三区 | 国产免费观看视频 | 精品久久久久一区二区国产 | 成人自拍视频网站 | 一区二区日韩 | 亚洲国产日韩欧美 | 福利片一区二区 | 日韩蜜桃视频 | 久久婷婷av| 韩国欧洲一级毛片 | 国产伦精品一区二区三区精品视频 | 国产精品久久久亚洲 | 日韩精品999 | 国产精品高潮呻吟久久 | 婷婷成人在线 | 日本不卡一区二区三区 | 性国产丰满麻豆videosex | 精品国产91乱码一区二区三区 | 国产成人啪免费观看软件 | 亚洲成在线观看 | 亚洲夜射| 一区二区三区av | 日韩一区二区福利视频 | 欧美精品91爱爱 | 天堂成人国产精品一区 | 毛片的网址 | 狠狠伊人 | 色婷婷av777 av免费网站在线 | 国产精品国产亚洲精品看不卡15 | 亚洲成人自拍 | 精品国模一区二区三区欧美 | 日韩欧美1区2区 |