How can I link VC ++ 2015 distributed with my ClickOnce (.NET) application?

I have a C # application running on the .NET Framework 4.5 deployed through Microsoft ClickOnce. I also use a small utility from the Microsoft SDK called DComPerm.exe, which is a C ++ application that I had to compile separately. My main application uses Process.Start() to access this executable.

When I first tried to run this on the client machine, I got an error message indicating that VCRUNTIME140.dll was missing when the application tried to call DComPerm.exe.

VCRUNTIME140.dll missing

That makes sense ... since this program was compiled in C ++, it needs the Redibbibable package for Visual C ++ 2015, which was not installed on the client machine. I want to make this as painless as possible, so I was hoping I could connect VC ++ 2015 Redist to my ClickOnce application. In the "Project Properties"> "Publish Tab" section, the "Prerequisites" button will appear, which allows me to indicate that the application should bind the redistributable package.

Prerequisites on the Publish Tab

That sounds great in theory, but it doesn't work. Now when I try to install the ClickOnce application on the client machine, it does not work. The installation failed and points me to a log file that contains the following information:

'Visual C ++ "14" Runtime Libraries (x86) "RunCheck Result: Install Needed

The installation of Visual C ++ components "14" Runtime Libraries (x86) "was adopted.

Copying files to the temporary directory "C: \ Users \ Owner \ AppData \ Local \ Temp \ VSD3872.tmp \"

Uploading files to the folder "C: \ Users \ Owner \ AppData \ Local \ Temp \ VSD3872.tmp \"

(8/4/2016 12:57:48 PM) Downloading 'vcredist_x86 \ vcredist_x86.exe' from ' http://go.microsoft.com/fwlink/?LinkID=800028&clcid=0x409 ' to 'C: \ Users \ Owner \ AppData \ Local \ Temp \ VSD3872.tmp \ '

Download completed on 8/4/2016 12:57:49 PM

Download failed with HRESULT = -2146697208

And this message allows you to understand what the problem is: the link that the redist is trying to use to download the package is dead. Only ... I'm not sure how I can say to find the right link. I am very surprised that he cannot find it automatically, as this seems like an error with Visual Studio. Some searches have shown that the correct link is actually this one , but this is not what ClickOnce permits. I also saw that by checking the box, this was the corresponding XML update for my csproj file:

 <BootstrapperPackage Include="Microsoft.Visual.C++.14.0.x86"> <Visible>False</Visible> <ProductName>Visual C++ "14" Runtime Libraries %28x86%29</ProductName> <Install>true</Install> </BootstrapperPackage> 

Is there any XML tag I can use to indicate the location explicitly? Or how else can I fix this? How can I link the redistributable without breaking my application?

+6
source share
1 answer

I had almost the same problem. You asked how to specify the download location that ClickOnce permits. To do this, open

 C:\Program Files (x86)\Microsoft Visual Studio 14.0\SDK\Bootstrapper\Packages\vcredist_x86\en\package.xml 

and edit the attribute with Name="https://go.microsoft.com/fwlink/..." to the correct URL. By the way, thanks for finding the correct download link, I could not find it until I saw this post.

After that, VC ++ Redis is installed correctly on the client computer.

+4
source

All Articles