[英]convert devenv parameters to msbuild parameters
我正在將一些解決方案遷移到 azure devops 中,並希望使用 MSBuild 任務來構建它們。 當前是使用 devenv 和以下命令構建的: 我以為我會嘗試 但我收到項目不包含“unittest debug”的錯誤我會很感激我能得到的任何幫助。 謝謝閱讀, ...
[英]convert devenv parameters to msbuild parameters
我正在將一些解決方案遷移到 azure devops 中,並希望使用 MSBuild 任務來構建它們。 當前是使用 devenv 和以下命令構建的: 我以為我會嘗試 但我收到項目不包含“unittest debug”的錯誤我會很感激我能得到的任何幫助。 謝謝閱讀, ...
[英]Could not run the "LC" task because MSBuild could not create or connect to a task host with runtime "CLR4" and architecture "x64"
我正在使用 VS 2019。從 bitbucket 克隆項目后,我就可以構建解決方案。 如果我在清理解決方案或重建后嘗試構建,則會收到此錯誤。 嚴重性代碼說明項目文件行抑制 State 錯誤無法運行“LC”任務,因為 MSBuild 無法創建或連接到具有運行時“CLR4”和體系結構“x64”的任務主 ...
[英]<When> element below <Choose> element is unknown — why?
我手動編輯了我的 MSBuild 文件以僅在滿足特定條件時執行一些命令:<?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http:/ ...
[英]MSBuild: Update the C++ PreprocessorDefinitions with my custom target
我正在嘗試創建一個自定義 MSBuild 目標以自動將 SVN 修訂號提取到某個定義中,比如 MY_VERSION。 所以,我的目標文件(get-svn-info.targets): 最后,修改項目文件: 但是編譯器說 'MY_VERSION': undeclared identifier her ...
[英]MSBuild can't exec command `npm i` while compiling a project in Rider/Visual Studio
我需要使用 Visual Studio for Mac 或 Jetbrains Rider 在 Mac 中構建和運行 .NET 5 項目。 在解決方案中其中一個項目的csproj文件中,我有以下目標: 當我運行dotnet build或dotnet msbuild項目構建時很好,但是在 VS/Ri ...
[英]How to reference ItemGroup Identity within the definition of the var
我有一個像下面這樣的目標。 它需要用新內容替換文件的內容。 我有多個文件與 ItemGroup 匹配。 我想不出辦法讓這個工作。 這是我的目標定義。 我希望我能正確解釋我想做的事情。 構建目標時,我收到一個錯誤,指出 File::ReadFile() 的路徑不能為空字符串。 我正在使用 VS 20 ...
[英]Is the TaskFactory attribute really optional in the <UsingTask> element?
<UsingTask>元素中的TaskFactory屬性真的是可選的嗎? Microsoft 的文檔聲明它是可選的。 我玩過<UsingTask>元素的語法,但我無法想出不必指定TaskFactory屬性的情況。 下面是將為我編譯而不會出錯的最小代碼片段: 我的興趣是學 ...
[英]Redirect all resources (exe | dll | conf) from bin\Release to a common output folder
我想知道是否有任何 MSBuild 功能允許我們將所有資源(exe | dll | conf)從 bin\Release 重定向到基於 Directory.build.propos / Directory.build.target 的所有項目的公共 output 文件夾。 實際上,我正在使用 Azu ...
[英]How to create or update the value of an element using XmlPoke
在 MSBuild 目標中,我需要將 XML 元素的值設置為特定值。 如果該元素不存在,我需要創建它。 我正在嘗試使用 MSBuild 的XmlPoke任務來實現這一點,但它只有在元素已經存在時才有效。 這是一個例子: XML 內容更新:<?xml version="1.0" encodin ...
[英]Create a reusable build task in .NET
我想將一個程序集(我們稱之為Plugin1.dll )復制到幾個可以使用這個插件的不同應用程序中。 目前我在 plugins.csproj/.fsproj 文件中做這樣的事情: 像這樣,我可以將我的Plugin1.dll復制到AppA 、 AppB和AppC中。 但是,我需要將 11 行代碼復制到我 ...
[英]TeamCity + Msbuild: The "TransformXml" task could not be loaded
我有一個項目,我正在嘗試使用 TeamCity 在 .NET 6 下構建。 構建總是失敗並顯示錯誤消息: 錯誤 MSB4062:無法從程序集中加載“TransformXml”任務... 我找到了這個線程並決定安裝MSBuild.Microsoft.VisualStudio.Web.targets N ...
[英]Build pixel shader project in VS2022
我有一個舊的類庫項目,它在以前版本的 Visual Studio (2017 IIRC) 中構建良好。 該項目包含一個基於 HLSL 的像素着色器,可生成徑向顏色選擇器。 我剛剛將它移植到 VS2022,它不再構建,告訴我它找不到構建任務。 這是錯誤消息: 無法從程序集 ShaderBuildTas ...
[英]Custom MSBuild Task .NET 6.0 Runs With dotnet but not in VS
我有一個簡單的項目,它有一個自定義 MSBuild 任務。 此任務將使用 dotnet msbuild 運行,但通過 VS2022 失敗。 除了與 .NET 6.0 引入的架構有關的一些問題外,我沒有在網上找到任何東西,我認為這些問題不適用於此。 我認為鑒於 dotnet cli 將毫無問題地構建它 ...
[英]Copying files after the msbuild do copy to the root folder $(build.ArtifactStagingDirectory)
I want to copy some of the files from the $(Build.SourcesDirectory) to the final package in azure deployment but after the msbuild it creates a name ...
[英]How to display Text on MSBuild only when ItemGroup Count > 0?
我有以下目標: 我不知道如何使上述<Message>僅在 FileToDelete 變量Count > 0時出現? 如何在 MSBuild 中做到這一點? 我總是得到這條線:圖片在這里 MSBuild 集合值中是否存在某些內容:即: Condition = "@(FileT ...
[英]Make MSBuild target depend on target from a different project
我有一個設置,我有一個 API (ASP.NET) 項目和一個測試項目來測試 API。 我使用 NSwag 通過以下步驟在測試項目中自動生成 API 客戶端: 構建 API 項目后,使用 NSwag 從生成的 DLL 生成 OpenAPI 定義 在構建 API 測試項目之前,使用 (1) 中 ...
[英]Best Way to replicate ClCompile/Link targets to elimiate to eliminate 2 pass Msbuild VS2019 plugin
我正在嘗試消除觸發第二次 MSBuild 傳遞的 Visual Studio 2019 插件。 給定:自定義構建任務從 *.bla 文件創建 *.cpp 模塊的構建流程。 然后將它們與其他 *.cpp 模塊鏈接以創建 EXE。 處理 *.bla 文件所需的信息要求運行生成的 exe。 真正的先有 ...
[英]How to add a project or target to msbuild solution that builds other projects in the same solution?
想知道是否有一種簡單的方法可以使用 Visual Studio 解決方案來做我想做的事情。 我有一個包含 10 多個 VC++ 項目的解決方案。 這些項目彼此之間沒有任何依賴關系。 我想在構建所有子項目的解決方案上創建 msbuild 目標。 就像是: msbuild mysolution.s ...
[英]Similar to PipelineCopyAllFilesToOneFolderForMsdeployDependsOn for UWP packaging
ITNOA 正如您在Web 部署工具 (MSDeploy) 中看到的:構建包,包括額外文件或排除特定文件以及將自定義文件添加到 MSDeploy 包msbuild 所需目標具有名稱為PipelineCopyAllFilesToOneFolderForMsdeployDependsOn的屬性事件, ...
[英]GeneXus: How to export properties of Knowledge Base / Version / Generators / Environments with an MSBUILD task?
使用 Genexus IDE 很容易將 KB 屬性導出到文件中。 是否可以使用 MSBUILD 任務做同樣的事情? ...