Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

wpf - In Visual Studio 2012 where does ClickOnce "Publish" expect to find the .Net 4 client profile?

The Publish feature stopped working once I installed Visual Studio 2012. Publish cannot find the prerequisite Microsoft .Net Framework 4 Client Profile (x86 and x64). Previously in Visual Studio 2010 this worked fine. I use 64-bit Windows 7.

The exact Visual Studio 2012 error message reads:

Error 104 - To enable 'Download prerequisites from the same location 
as my application' in the Prerequisites dialog box, you must download file
'DotNetFX40ClientdotNetFx40_Client_x86_x64.exe' for item 'Microsoft .NET 
Framework 4 Client Profile (x86 and x64)' to your local machine. For more 
information, see http://go.microsoft.com/fwlink/?LinkId=239883

I placed the file dotNetFx40_Client_setup.exe in the location: C:Program Files (x86)Microsoft SDKsWindowsv8.0ABootstrapperPackagesDotNetFX40Client

I also left it in it's original location (note the v7.0A):

C:Program Files (x86)Microsoft SDKsWindowsv7.0ABootstrapperPackagesDotNetFX40Client

Edit (after solving the problem): I see that the correct setup file (dotNetFx40_Client_x86_x64.exe) is actually in the v7.0A folder. Had I just copied it from there everything would have worked (rather than downloading the wrong setup).

Publish works fine when I change the option "Download prerequisites from the same location as my application" to "Download prerequisites from the component vendor's website" (at project Properties -> Publish -> Prerequisites...)

I noticed a yellow exclamation point beside the (checked) "Windows Installer 3.1" with the warning: "Prerequisite could not be found for bootstrapping". For that I have the file WindowsInstaller-KB893803-v2-x86.exe in the folder:

C:Program Files (x86)Microsoft SDKsWindowsv7.0ABootstrapperPackagesWindowsInstaller3_1

The application has run fine within my company's network for the past year when published with Visual Studio 2010. I opened the solution file in VS 2012 (for the first time) and it compiles and runs fine locally. Only the Publish feature is broken.

Am I missing something? Where is ClickOnce Publish expecting to find these prerequisites for my WPF application?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I'm answering my own question. The problem went away when I used a different .Net 4 Client setup program. The exe that works for me is dotNetFx40_Client_x86_x64.exe found at:

http://www.microsoft.com/en-us/download/details.aspx?id=24872

The wrong setup program is dotNetFx40_Client_setup.exe which I was led to by following the Microsoft MSDN help topic How to: Include Prerequisites with a ClickOnce Application (Visual Studio 2012) which led me to this link to the setup. I use Chrome which downloaded the web installer which I didn't realize was not the file I needed. Had I been using IE none of this would have happened. I was clued into the problem by this StackOverflow question which suggests renaming the setup program. Instead of renaming it I just downloaded the correct one.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...