I have a C# project in a solution I built in VS2019 Enterprise, using .NET 4.8, and since this is a tool for internal use only, 1) the build log I'll be posting will be redacted, and 2) I know exactly the hardware and .NET version of every computer that'll run this, because they're all identical to my own.
The assembly is signed with a hardware key because we use whitelisting to determine what can and cannot run on said laptops, (so I HAVE to build this locally,) and I'm only building x64 because of the memory demands of the tool. (Yes, I've watched it run, yes it uses over 2GB of RAM, and no, I can't do anything about that. You'll just have to take my word on that.)
So all that said, I installed the Microsoft-made extension to try and create an MSI installer, because this needs to be as easy to install as possible, and it keeps failing. Output below.
1>------ Rebuild All started: Project: MyCSProject, Configuration: Release x64 ------
1> MyCSProject -> C:\dev\Source\Repos\MySolution\MyCSProject\bin\x64\Release\MyCSProject.exe
1> Done Adding Additional Store
1> Successfully signed: C:\dev\Source\Repos\MySolution\MyCSProject\bin\x64\Release\MyCSProject.exe
1>
------ Starting pre-build validation for project 'MyCSProject Setup' ------
------ Starting pre-build validation for project 'MyCSProject Setup' ------
------ Starting pre-build validation for project 'MyCSProject Setup' ------
WARNING: Unable to find dependency 'MICROSOFT.WINDOWSAPICODEPACK' (Signature='(null)' Version='1.1.0.0') of assembly 'Microsoft.WindowsAPICodePack.Shell.dll'
WARNING: Unable to find dependency 'MICROSOFT.WINDOWSAPICODEPACK' (Signature='(null)' Version='1.1.0.0') of assembly 'Microsoft.WindowsAPICodePack.Shell.dll'
WARNING: Unable to find dependency 'MICROSOFT.WINDOWSAPICODEPACK' (Signature='(null)' Version='1.1.0.0') of assembly 'Microsoft.WindowsAPICodePack.Shell.dll'
------ Pre-build validation for project 'MyCSProject Setup' completed ------
------ Pre-build validation for project 'MyCSProject Setup' completed ------
------ Pre-build validation for project 'MyCSProject Setup' completed ------
2>------ Rebuild All started: Project: MyCSProject Setup, Configuration: Release ------
2>------ Rebuild All started: Project: MyCSProject Setup, Configuration: Release ------
2>------ Rebuild All started: Project: MyCSProject Setup, Configuration: Release ------
Building file 'C:\dev\Source\Repos\MySolution\MyCSProject Setup\Release\MyCSProject Setup.msi'...
Building file 'C:\dev\Source\Repos\MySolution\MyCSProject Setup\Release\MyCSProject Setup.msi'...
Building file 'C:\dev\Source\Repos\MySolution\MyCSProject Setup\Release\MyCSProject Setup.msi'...
WARNING: Xml validation did not pass for item 'Microsoft .NET Framework 4.8 (x86 and x64)' located at 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX48\product.xml'.
WARNING: Xml validation did not pass for item 'Microsoft .NET Framework 4.8 (x86 and x64)' located at 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX48\product.xml'.
WARNING: Xml validation did not pass for item 'Microsoft .NET Framework 4.8 (x86 and x64)' located at 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX48\product.xml'.
WARNING: Xml Validation error in file 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX48\product.xml': The element 'InstallConditions' in namespace 'http://schemas.microsoft.com/developer/2004/01/bootstrapper' cannot contain text. List of possible elements expected: 'http://schemas.microsoft.com/developer/2004/01/bootstrapper:BypassIf http://schemas.microsoft.com/developer/2004/01/bootstrapper:FailIf'.
WARNING: Xml Validation error in file 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX48\product.xml': The element 'InstallConditions' in namespace 'http://schemas.microsoft.com/developer/2004/01/bootstrapper' cannot contain text. List of possible elements expected: 'http://schemas.microsoft.com/developer/2004/01/bootstrapper:BypassIf http://schemas.microsoft.com/developer/2004/01/bootstrapper:FailIf'.
WARNING: Xml Validation error in file 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX48\product.xml': The element 'InstallConditions' in namespace 'http://schemas.microsoft.com/developer/2004/01/bootstrapper' cannot contain text. List of possible elements expected: 'http://schemas.microsoft.com/developer/2004/01/bootstrapper:BypassIf http://schemas.microsoft.com/developer/2004/01/bootstrapper:FailIf'.
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
ERROR: File 'MyCSProject.exe' of project output 'Primary output from MyCSProject (Active)' targeting 'AMD64' is not compatible with the project's target platform 'x86'
ERROR: File 'MyCSProject.exe' of project output 'Primary output from MyCSProject (Active)' targeting 'AMD64' is not compatible with the project's target platform 'x86'
ERROR: File 'MyCSProject.exe' of project output 'Primary output from MyCSProject (Active)' targeting 'AMD64' is not compatible with the project's target platform 'x86'
WARNING: File 'MyCSProject.exe' of project output 'Primary output from MyCSProject (Active)' targeting 'x64' is not compatible with the project's target platform 'x86'
WARNING: File 'MyCSProject.exe' of project output 'Primary output from MyCSProject (Active)' targeting 'x64' is not compatible with the project's target platform 'x86'
WARNING: File 'MyCSProject.exe' of project output 'Primary output from MyCSProject (Active)' targeting 'x64' is not compatible with the project's target platform 'x86'
Build process cancelled
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
(If there's a language that I can specify that'll make the build log easier to read, by all means, let me know. I can also post the content of the Product.xml
that the log mentions, but since it's 97 lines long, I won't unless necessary.)
Side note, I'm not even using anything HTTP, (this is strictly a Windows Forms program,) so I have no idea why system.net.http.dll
is being included at all. The tool is still in development, so I'll have to re-build several times before it's done, no doubt, but I'm just trying to get this thing in a format that I can get to their laptops, because we're flung all over the country.
So why isn't it building? I'm finding there's little documentation on this, especially anything recent. What's supposed to happen, as the first few lines indicate, is an MSI should be built that installs my exe and any DLLs that can't be rolled into the EXE.
(FWIW, I've also tried using the Publish option in VS, but then it complains about a malformed .manifiest, and it still doesn't create that "one and done" installer that I'm looking for.)
Update
Gonzix's answer got rid of the errors, but I still have some Warnings. Are these a big deal? Can I safely deploy as-is, or do I need to do something else?
WARNING: Unable to find dependency 'MICROSOFT.WINDOWSAPICODEPACK' (Signature='(null)' Version='1.1.0.0') of assembly 'Microsoft.WindowsAPICodePack.Shell.dll'
------ Pre-build validation for project 'MyCSProject Setup' completed ------
2>------ Rebuild All started: Project: MyCSProject Setup, Configuration: Release ------
Building file 'C:\dev\Source\Repos\MySolution\MyCSProject Setup\Release\MyCSProject Setup.msi'...
WARNING: Xml validation did not pass for item 'Microsoft .NET Framework 4.8 (x86 and x64)' located at 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX48\product.xml'.
WARNING: Xml Validation error in file 'C:\Program Files (x86)\Microsoft SDKs\ClickOnce Bootstrapper\Packages\DotNetFX48\product.xml': The element 'InstallConditions' in namespace 'http://schemas.microsoft.com/developer/2004/01/bootstrapper' cannot contain text. List of possible elements expected: 'http://schemas.microsoft.com/developer/2004/01/bootstrapper:BypassIf http://schemas.microsoft.com/developer/2004/01/bootstrapper:FailIf'.
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.net.http.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')
WARNING: Two or more objects have the same target location ('[targetdir]\system.runtime.dll')
My main concern is some dueling-DLL situation where the end user's computer somehow gets confused, or something that causes the tool that does the whitelisting to scream. I know my laptop's configured for that tool to scream less, (VS would never run otherwise,) so I'd like there to be zero warnings, not just zero errors...
TL;DR are the warnings that I'm still getting a problem or not? Under what circumstances COULD they be a problem?