I am using clickonce for a windows forms application. I have to deploy some resource assemblies. These assemblies are in a folder in my project (not as a reference). They are marked BuildAction = content and CopyToOutputDir = Copy If Newer. With this configuration I'm getting the warning MSB3178: Assembly '' is incorrectly specified as a file.
When I set the BuildAction to none, the warnings disappear, but the assemblies that must deploy not appear in ClickOnce Application Files.
I would like to add these assemblies (there are many) in the publication of clickonce without this warning and without adding these dlls as references in the project. I researched a lot and could not find a solution to disable the warning.
Edit:
The warning appears only when I set "Enable Clickonce Security Settings" = "True" in "Project / Properties / Security Tab"
SAMPLE PROJECT:
Click to download the sample project
Just build and check the Warnings.
Suppressing MSBuild warnings is still not possible.
Warnings with MSB prefix are thrown by MSBuild. Currently, we can't suppress MSBuild warnings.
Ref: https://social.msdn.microsoft.com/Forums/vstudio/en-US/96b3ea2e-92ed-4483-bbfe-a4dda3231eb9/suppress-msb4126?forum=tfsbuild
There are a few you can suppress in the PropertyGroup of your .csproj file, for example:
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
However none exist for the incorrectly specified as a file warning.
Related SO threads here and here and on MSDN. The exact same question on MSDN.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With