msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

[Build Warning]: MSB3178 for mstest dlls in a click once publish exe project

Open HenningOI opened this issue 2 years ago • 13 comments

Issue Description

On our Azure Devops Pipeline, we get the following warnings during the build process (msbuild) for an net framework 4.8 exe project that contains unit tests, using mstest. This project is also published using click once:

##[warning]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): Warning MSB3178: Die C:\Users\tfsadmin.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.TestPlatform.AdapterUtilities.resources.dll-Assembly wurde falsch als Datei angegeben.

The same warning happens for:

Microsoft.TestPlatform.CoreUtilities.resources.dll Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll

There are no warnings for a local build on our developer machines.

These are "localization files", could it have something to do with the fact that our devops build server runs on a german operating system?

Is there anything we can do here?

Posted my problem also here: https://developercommunity.visualstudio.com/t/Pipeline-build-warnings-for-TestPlatform/10538416#T-ND10544129

Steps to Reproduce

Too difficult to reproduce

Expected Behavior

Build runs without warnings.

Actual Behavior

MSB3178 Warnings are shown

Ask us questions

No response

HenningOI avatar Dec 19 '23 09:12 HenningOI

@Lumoryel I assume you get these warnings outside of the AzDO pipeline as well? If so, please run the msbuild CLI from your pipeline task with the /bl switch and attach the msbuild.binlog to your reply. Thanks.

sujitnayak avatar Dec 19 '23 16:12 sujitnayak

@sujitnayak no it only happens on the Devops pipeline, not on local computers. I guess the binlog would contain private information (all DLL names etc.) that I don't want to share public?

HenningOI avatar Dec 20 '23 12:12 HenningOI

@Lumoryel

In that case, you would need to create a minimal sample that reproduces the error and share that.

The warning suggests that assembly references are being passed as file references to the ClickOnce msbuild task. You can also investigate this by generating the binlog and comparing with the log from the local computer to determine why these assemblies are being passes as files. You can search online for the 'msbuild binlog viewer' tool that can open these binlog files.

sujitnayak avatar Jan 05 '24 20:01 sujitnayak

I created a test app which makes those warnings on the build-server but not on a local machine:

TestAppMSB3178.zip

  • New WPF Application (.Net Framework)
  • Add Nuget Reference for MSTest.TestAdapter and MSTest.TestFramework

I don't know if these things are necessary to get the warning but we have those settings in our productive project:

  • Enable Click-Once Security Settings, "This is a full trust application"
  • Publish "Install Mode and Settings" switched to "The Application is availble online only"

HenningOI avatar Jan 12 '24 14:01 HenningOI

@Lumoryel I assume you're seeing this in an AzDO pipeline job. If so, could you please also provide the command line your task invokes in the pipeline?

sujitnayak avatar Jan 26 '24 23:01 sujitnayak

I'm not sure if this is the right one:

2024-01-29T07:41:58.4498809Z     99>CoreCompile:
2024-01-29T07:41:58.4502178Z          C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702 /fullpaths /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Microsoft.CSharp.dll" /reference:C:\Users\tfsadmin\.nuget\packages\mstest.testframework\3.1.1\lib\net462\Microsoft.VisualStudio.TestPlatform.TestFramework.dll /reference:C:\Users\tfsadmin\.nuget\packages\mstest.testframework\3.1.1\lib\net462\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\PresentationCore.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\PresentationFramework.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Net.Http.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xaml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.Linq.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\WindowsBase.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\TestAppMSB3178.exe /subsystemversion:6.00 /target:winexe /utf8output /deterministic+ /langversion:7.3 App.xaml.cs MainWindow.xaml.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\obj\Debug\MainWindow.g.cs C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\obj\Debug\App.g.cs C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\obj\Debug\TestAppMSB3178_Content.g.cs
2024-01-29T07:41:58.7622192Z     99>CoreCompile:
2024-01-29T07:41:58.7625655Z          CompilerServer: server - server processed compilation - f96bf04f-5ca1-4ffe-9aa2-bbbce5410fd3
2024-01-29T07:41:58.7630951Z     99>Die Erstellung von Projekt "C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\TestAppMSB3178_4eec2ibz_wpftmp.csproj" ist abgeschlossen (_CompileTemporaryAssembly Ziel(e)).

[...]

2024-01-29T07:41:59.4237221Z     95>MarkupCompilePass2:
2024-01-29T07:41:59.4238215Z          BAML- oder Quellcodedateien wurden erfolgreich von "MarkupCompilePass2" generiert.
2024-01-29T07:41:59.4245302Z        CleanupTemporaryTargetAssembly:
2024-01-29T07:41:59.4245754Z          Die Datei "obj\Debug\TestAppMSB3178.exe" wird gelöscht.
2024-01-29T07:41:59.4585405Z        CoreResGen:
2024-01-29T07:41:59.4588941Z          "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Microsoft.CSharp.dll" /r:C:\Users\tfsadmin\.nuget\packages\mstest.testframework\3.1.1\lib\net462\Microsoft.VisualStudio.TestPlatform.TestFramework.dll /r:C:\Users\tfsadmin\.nuget\packages\mstest.testframework\3.1.1\lib\net462\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\PresentationCore.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\PresentationFramework.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Core.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.DataSetExtensions.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Net.Http.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xaml.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.Linq.dll" /r:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\WindowsBase.dll" /compile Properties\Resources.resx,obj\Debug\TestAppMSB3178.Properties.Resources.resources
2024-01-29T07:41:59.4591554Z          Die Ressourcendatei "Properties\Resources.resx" wird zu "obj\Debug\TestAppMSB3178.Properties.Resources.resources" verarbeitet.
2024-01-29T07:41:59.7088332Z        CoreCompile:
2024-01-29T07:41:59.8357091Z          C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Roslyn\csc.exe /noconfig /nowarn:1701,1702 /fullpaths /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:DEBUG;TRACE /highentropyva+ /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\Microsoft.CSharp.dll" /reference:C:\Users\tfsadmin\.nuget\packages\mstest.testframework\3.1.1\lib\net462\Microsoft.VisualStudio.TestPlatform.TestFramework.dll /reference:C:\Users\tfsadmin\.nuget\packages\mstest.testframework\3.1.1\lib\net462\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\PresentationCore.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\PresentationFramework.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Net.Http.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xaml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.Xml.Linq.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\WindowsBase.dll" /debug+ /debug:full /filealign:512 /nowin32manifest /optimize- /out:obj\Debug\TestAppMSB3178.exe /subsystemversion:6.00 /resource:obj\Debug\TestAppMSB3178.g.resources /resource:obj\Debug\TestAppMSB3178.Properties.Resources.resources /target:winexe /utf8output /deterministic+ /langversion:7.3 App.xaml.cs MainWindow.xaml.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\obj\Debug\MainWindow.g.cs C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\obj\Debug\App.g.cs C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\obj\Debug\TestAppMSB3178_Content.g.cs "obj\Debug\.NETFramework,Version=v4.8.AssemblyAttributes.cs"
2024-01-29T07:42:00.2467011Z     95>CoreCompile:
2024-01-29T07:42:00.2473099Z          CompilerServer: server - server processed compilation - bd3369a4-a4f1-413c-96d7-7b13342875e5
2024-01-29T07:42:00.4202656Z        _DeploymentComputeClickOnceManifestInfo:
2024-01-29T07:42:00.4202982Z          Das Verzeichnis "bin\Debug\app.publish" wird erstellt.
2024-01-29T07:42:00.4204914Z          Die Datei wird von "C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\obj\Debug\TestAppMSB3178.exe" in "C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\bin\Debug\app.publish\TestAppMSB3178.exe" kopiert.
2024-01-29T07:42:00.7586080Z ##[warning]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): Warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.TestPlatform.AdapterUtilities.resources.dll-Assembly wurde falsch als Datei angegeben.
2024-01-29T07:42:00.7597206Z     95>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.TestPlatform.AdapterUtilities.resources.dll-Assembly wurde falsch als Datei angegeben. [C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\TestAppMSB3178.csproj]
2024-01-29T07:42:00.7601585Z ##[warning]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): Warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.TestPlatform.CoreUtilities.resources.dll-Assembly wurde falsch als Datei angegeben.
2024-01-29T07:42:00.7602879Z     95>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.TestPlatform.CoreUtilities.resources.dll-Assembly wurde falsch als Datei angegeben. [C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\TestAppMSB3178.csproj]
2024-01-29T07:42:00.7605517Z ##[warning]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): Warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll-Assembly wurde falsch als Datei angegeben.
2024-01-29T07:42:00.7606734Z     95>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll-Assembly wurde falsch als Datei angegeben. [C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\TestAppMSB3178.csproj]
2024-01-29T07:42:00.7609458Z ##[warning]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): Warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll-Assembly wurde falsch als Datei angegeben.
2024-01-29T07:42:00.7610700Z     95>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll-Assembly wurde falsch als Datei angegeben. [C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\TestAppMSB3178.csproj]
2024-01-29T07:42:00.7613601Z ##[warning]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): Warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll-Assembly wurde falsch als Datei angegeben.
2024-01-29T07:42:00.7614781Z     95>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll-Assembly wurde falsch als Datei angegeben. [C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\TestAppMSB3178.csproj]
2024-01-29T07:42:00.7617466Z ##[warning]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): Warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll-Assembly wurde falsch als Datei angegeben.
2024-01-29T07:42:00.7618959Z     95>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): warning MSB3178: Die C:\Users\tfsadmin\.nuget\packages\mstest.testadapter\3.1.1\build\net462\..\_localization\de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll-Assembly wurde falsch als Datei angegeben. [C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\TestAppMSB3178.csproj]
2024-01-29T07:42:00.7621455Z ##[warning]C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): Warning MSB3181: Für mindestens zwei Dateien ist derselbe Zielpfad "de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" angegeben.
2024-01-29T07:42:00.7622732Z     95>C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(4199,5): warning MSB3181: Für mindestens zwei Dateien ist derselbe Zielpfad "de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" angegeben. [C:\agent\_work\1\s\WITec.Tests\TestAppMSB3178\TestAppMSB3178.csproj]

HenningOI avatar Jan 29 '24 08:01 HenningOI

@Lumoryel

I cannot reproduce the issue. I added your test project into a AzDO pipline with 3 tasks - NuGet Restore, MSBuild build and MSBuild publish. I don't get any 3178 MS warnings.

Here are the definitions of the 3 tasks in my pipeline:

steps:

  • task: NuGetCommand@2 displayName: 'NuGet restore' inputs: restoreSolution: 'src\scratch\TestApp\TestAppMSBuild3178.sln' feedsToUse: config nugetConfigPath: build/nuget.config

steps:

  • task: MSBuild@1 displayName: 'Build ' inputs: solution: '**/TestAppMSBuild3178.csproj' msbuildArchitecture: x64 configuration: Release

steps:

  • task: MSBuild@1 displayName: Publish inputs: solution: '**/TestAppMSBuild3178.csproj' msbuildArchitecture: x64 configuration: Release msbuildArguments: '/t:publish'

You can look at the corresponding YAML for your tasks and paste that in your reply.

If there is no difference, we would need to see your msbuild binlog for the test app. For that, you would need to add '/bl' to your msbuildArguments in the pipeline and then send that to us.

Thanks.

sujitnayak avatar Jan 29 '24 18:01 sujitnayak

This is our yml:

  steps:
  - checkout: self
    clean: true
  - task: NuGetToolInstaller@1
    displayName: Use NuGet
    inputs:
      versionSpec: 5.9.1
  - task: NuGetCommand@2
    displayName: NuGet restore
    inputs:
      solution: WITec.Tests/TestAppMSB3178/TestAppMSB3178.sln
      selectOrConfig: config
      nugetConfigPath: nuget.config
  - task: VSBuild@1
    displayName: Build solution WITec.Tests/TestAppMSB3178/TestAppMSB3178.sln
    inputs:
      solution: WITec.Tests/TestAppMSB3178/TestAppMSB3178.sln
      msbuildArgs: -bl:C:\Users\tfsadmin\Desktop\WITecBuild.binlog
      maximumCpuCount: true

Attached also the binlog file. WITecBuild.zip

HenningOI avatar Jan 30 '24 09:01 HenningOI

@Lumoryel

From the binlog, the EnableMSTestV2CopyResources is set to True. The MSTest.TestAdapter package has a .targets file that will include the resource DLLs as Content Items when this property is true.

ClickOnce publishes items in the Content group as files but in this case, it sees assemblies in the group and emits the MSB3178 warning.

There are 2 options to avoid the warnings:

  1. You can either unset the EnableMSTestV2CopyResources property or set it to FALSE if you do not want to publish these assemblies as Content Items.
  2. Remove the resource DLLs from the Content group by adding this to your csproj: <Content Remove="@(MSTestV2ResourceFiles)"/>

Thanks.

sujitnayak avatar Feb 07 '24 00:02 sujitnayak

Thank you @sujitnayak, where would I unset "EnableMSTestV2CopyResources", in the csproj project file? Your point 2. is missing some text? Best Henning

HenningOI avatar Feb 07 '24 10:02 HenningOI

The EnableMSTestV2CopyResources is likely defined somewhere in your pipeline. I am not able to say for sure but I can see it is set to true in the binlog. It could be an environment variable defined in your pipeline or something that is passed as a parameter in your msbuild commandline.

The second option is to remove the @(MSTestV2ResourceFiles) group from your Content group as such: <Content Remove="@(MSTestV2ResourceFiles)"/>

sujitnayak avatar Feb 07 '24 20:02 sujitnayak

I tried using the content remove tag in the csproj file, but the warnings still exist.

In the pipeline definition I could not find any declarations for this variable.

Maybe there is some more ideas how to find this problem?

HenningOI avatar Feb 19 '24 10:02 HenningOI

@Lumoryel I was mistaken. The EnableMSTestV2CopyResources defaults to Yes in the MSTest.TestAdapter.targets file. It appears that your build machine has the CurrentUICulture (Display Language) set to de-de which is the reason the resource DLLs get added to the Content group for publishing.

The options you can try are:

  1. Change the Display Language of the build machine to 'English (United States)' so that CUrrentUICulture resolves to en-US.
  2. Change the msbuild command line of your publishing task to set the EnableMSTestV2CopyResources to false by passing "/p:EnableMSTestV2CopyResources=false"

sujitnayak avatar Feb 20 '24 19:02 sujitnayak

@sujitnayak thank you, I used option 2 and it works.

It was not possible to add english display language via normal settings dialog in Windows Server 2019.

Anyways: there should be no warning, no matter which display language or am I wrong?

HenningOI avatar Feb 21 '24 09:02 HenningOI

@Lumoryel The MSB3178 warning from ClickOnce is relevant in that assemblies have been added for publishing in the Content group. The Content group typically contains data files that need to be published so having assemblies in it is atypical.

The root cause is the MSTest.TestAdapter package behavior that reads the CurrentUICulture on the build machine and decides to publish these assemblies as content.

Your project is referencing version 3.1.1 of the package so you could try referencing the latest version to see if package authors have mitigated this behavior.

Thanks.

sujitnayak avatar Feb 21 '24 19:02 sujitnayak

Closing the issue since the ClickOnce warnings have been mitigated.

sujitnayak avatar Feb 21 '24 19:02 sujitnayak