You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This warning occurs when MSBuild tries to process a manifest file, but encountered a file that looks like an assembly that was specified as an ordinary file, instead of using the correct XML structure for an assembly. Assembly manifests used in ClickOnce deployment for .NET applications are XML files that contain a XML-encoded of the contents of an application, which might include assemblies and files. Assemblies are specified using the `assembly` element, which also includes child elements such as as `assemblyInformation`; plain files are specified using the `file` element.
38
+
39
+
In Visual Studio when you generate a ClickOnce manifest using the Publish process, you might get this warning if you specify a DLL or EXE with the `Build Action` set to `Content`. In Visual Studio, `Content` means add something as an ordinary file, not as an assembly. In a project file, `Content` is an item group. If the item group contains files that look like assemblies, you get this warning.
40
+
41
+
## Resolution
42
+
43
+
Check the assembly manifest XML file for the assembly given in the text of the error message. For more information, see [Assembly manifest](/dotnet/standard/assembly/manifest). You can generate a binary log to see why a particular file is being passed as an assembly. Use the `-bl` switch on the MSBuild command line, and then use the [MSBuild structured log viewer](https://msbuildlog.com) to open the binary log (`.binlog` file).
44
+
45
+
If your project file contains an item group `Content` or your Visual Studio project specifies the `Build Action` as `Content` for some files with the DLL or EXE extension, consider whether this is intentional or not.
46
+
47
+
If your manifest file was generated by a custom tool or process, check any `file` elements to see if any of them reference files that should be referenced as assemblies instead (look for file extensions such as `.dll` or `.exe`.). If it was generated by a tool or MSBuild task, check the command line syntax, shell expansions, and validate any input files to the tool or task.
48
+
49
+
You can disable this warning by using the `NoWarn` property:
50
+
51
+
`<NoWarn>$(NoWarn);MSB3178</NoWarn>`
52
+
53
+
You should only disable the warning if you've verified that including what appear to be assemblies as ordinary files is valid and intentional in your scenario.
0 commit comments