Clickonce WPF application with custom and default prerequisites - c#

I have a .Net 4 WPF ClickOnce app that has .NET Framework 4, VC++ 2013 Runtime Libraries and Windows Installer 4.5 as prerequisites.
I now have to add VC++ 2010 Libraries.
I have followed the steps here to create a custom prerequisite package. In visual studio, the package shows up in my prerequisite list. However, the installer is not attempting to install the VC++2010 package.
product.xml
package.xml
I have downloaded the vcredist_x86.exe into the package directory, however I am unsure what to set under "Specify the install location for prerequisites", since I am now mixing custom and default pre-reqs.
Any assistance would be much appreciated!
Edit: I have logged my clickonce installation and see nothing referencing the VC++ package at all. No errors or anything.

The following configurations worked without having to include the package in the deploy.
package.xml
package.xml
product.xml
product.xml
I placed the files above in a new directory:
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\vcredist_x86-2010\product.xml
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\vcredist_x86-2010\en\package.xml
Note: I did not include the vcredist_x86.exe package anywhere in the bootstrapper directory - it is downloaded during installation.
Before the installer is run, on a fresh Windows 8.1 install;
Prompt for prerequisites;
After installer, both C++ Runtime Libraries installed;

Related

Visual Studio 2019 shows an empty solution after creating a .NET Core project

When I create a new .NET Core project in Visual Studio 2019, it shows only the solution file. Other files are not showing and also I am not able to debug or the project.
I've also run into this problem and after two days of searching forums and reading .NET documentations, I finally managed to find the solution.
The problem is that Visual Studio cannot find the proper SDK version. There might be a few reasons for this, but first of all, check if you have any SDK installed:
Open the Command Prompt:
Start Menu > Visual Studio 2019 > Developer Command Prompt for Visual Studio 2019
Run the command: dotnet --info
Case 1:
The .NET SDKs installed: section says that you have no SDKs installed.
-OR-
A .NET SDK is installed but not for the right architecture (this was my case), meaning that you had installed x86 version instead of x64.
Solution:
Uninstall all versions of .NET Core SDKs and Runtimes, then download and install the latest x64 SDK and Runtime version from Microsoft's webpage.
Case 2:
A .NET SDK is installed but the referenced SDK version in the current project's .csproj file does not match the installed version nor the one specified in the global.json (if exists).
Solution: Edit the .csproj file, so that the SDK versions match.
If you have or need a global.json file, make sure you set its content properly. You can read more about it here.
Finally
Don't forget to open Visual Studio, create a new e.g. Console Application and see if the Solution's files appear in the Solution Explorer window (they should). Note that existing projects may still not be working properly because their .csproj file might have wrong SDK reference - if so, you have to fix them manually.

MSBUILD used in from wrong location in VS2017 after uninstalling VS2015? XmlSerializers builds with incorrect versions

I uninstalled VS2017 and VS2015 and only re-installed VS2017. Now, on some asp.net 3.5 assemblies that were previously building/working fine in VS2017 are no longer building correctly.
Even though the project references system.xml v2.0, when it is build, the *.XmlSerializers assembly pulls in the v4.0 version of the assembly. Causing our sites running on the asp.net 2.0 application pool to no longer function.
Here is my assembly Application settings:
Here is my project reference:
And here is Ildasm.exe showing the wrong system.xml pulled in:
The only bindings I have in the web.config are the following:
I'm trying to determine if it is build MSBuild is ran from the C:\Windows\Microsoft.NET\Framework\v4.0.30319 path or what.
UPDATE: I ran a build with detailed output on my desktop (the one that no longer functions properly) and my laptop (which still works). There were obviously lots of differences, but the ones that jumped out as possible issues are:
Laptop (still working)
SDK35ToolsPath = C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\
MSBuildVersion = 15.7.180
TargetFrameworkSDKToolsDirectory = C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\
VSSDK140Install = C:\Program Files (x86)\Microsoft Visual Studio 14.0\VSSDK\ missing from desktop
Microsoft (R) Visual C# Compiler version 2.8.3.63029 (e9a3a6c0) (TaskId:28)
Desktop (not working)
SDK35ToolsPath =
MSBuildVersion = 15.9.21
TargetFrameworkSDKToolsDirectory = C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\
Microsoft (R) Visual C# Compiler version 2.10.0.0 (b9fb1610) (TaskId:28)
Wonder if I should reinstall VS2015 again as well even though I'll never use the UI?
Copied from the comment.
VS2017/2019 no longer installs .NET Framework 3.5 SDK by default. That's why you saw SDK35ToolsPath is blank in MSBuild logging.
Go to VS2017/2019 installer and select .NET Framework 3.5 development tools to install. Then it should compile without problems.

Visual Studio Installer Projects including too many DLLs?

I am attempting to use Visual Studio Installer Projects to make an installer for my app. I am using Visual Studio 2015, and my app is built using WPF and .NET 4.5.
I was following this general tutorial on how to make a Visual Studio Installer Project: https://www.youtube.com/watch?v=z0v6hmumCFU
When I include the "primary output" of each of my projects in the installer, it goes out and identifies the dependencies of these projects and includes them as files that need to be in the installer. I am puzzled, however, because it even seems to be including several standard "system" .NET DLL files, as you can see in this image below:
I tried building it, and then running the installer that it builds, and sure enough it installs all of these "system" DLL files into the install directory.
My understanding is that these DLL files should be on the user's computer already in a standard location once the user has installed .NET 4.5 or later, so my installer shouldn't need to copy over many of these dependencies into the install directory.
So my question is thus:
(1) Why does the Visual Studio Installer Project extension include these dependencies which are obviously part of .NET and should really be located in a standard .NET install location?
(2) Would it be fine to exclude them?
(3) Is there a way to get the VS Installer Project extension to simply not add them?

Portable Class Library Projects Dont Work with NuGet

I have a funny error where NuGet will not work in Portable Class Library projects. I have created a portable class library project and when I attempt to search (through the NuGet dialog) or install (through the console) I get the following error:
Specified argument was out of the range of valid values. Parameter
name: supportedFrameworks
I had this error with all projects (Class, etc.) in VS2012 but I followed this advice and it has fixed it except for PCL projects. In a class project the NuGet dialog will list packages and install them just not in PCLs.
What is wrong and how can I fix this?
Note: I am creating a Xamarin Cross Platform project in VS2012 (ie the project is a PCL solution). Maybe this is the cause error - Xamarin's VS Extensions? I am also using VS2012 Professional Trial version - could this be the issue?
Edit Maybe I dont have my PCL setup? For example I dont have the folder C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile.
As far as I know Visual Studio 2012 does not include any Portable Class Libraries. They are installed with Visual Studio 2013. Otherwise you will have to install them yourself which involves several steps.
Install the Portable Library Tools and the Portable Library Reference Assemblies 4.6.
Extract the PCLs from the .zip file that the Portable Library Reference Assemblies 4.6 installs into C:\Program Files (x86)\Microsoft .NET Portable Library Reference Assemblies 4.6.
Copy the PCLs extracted into C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable.
Repair the Xamarin install so it adds its PCL profile xml files to the new PCL directories.

How to change the download and installation order of the prerequisites in ClickOnce

I need to postpone the download of some prerequisite in ClickOnce to be downloaded and installed at the last of the other prerequisites?
Find and edit the product.xml file for your bootstrapper package. The bootstrapper packages are located under the Microsoft SDKS folder. For example, this is the path on my machine...
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
See this question for a little more detail.

Categories

Resources