Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not use ClickOnce publish on .NET 4.0 application from Visual Studio 2012

I installed Visual Studio 2012 and went to go publish one of our applications, that is targeted at the .NET 4.0 framework. Due to the setup on these machines, we can not target 4.5 at this time. We are also using the 'Download prerequisites from the same location as my application' feature.

When going to deploy from Visual Studio 2012, I get the following error:

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

If you go to that link, it tells you to navigate to the Package.xml file, and find the link for the actual prerequisite. In my case, it should go to http://go.microsoft.com/fwlink/?linkid=182805. Using that link it downloaded a package named dotNetFx40_Full_setup.exe. I placed this in the /Packages/DotNetFX40 folder.

When trying to publish again from Visual Studio 2012, I got the same error. It seems that it does not like this file.

If I publish the same application to the same location with Visual Studio 2010 now, it still works just fine.

How can I get this to work with Visual Studio 2012?

like image 563
jmlumpkin Avatar asked Aug 27 '12 19:08

jmlumpkin


People also ask

How do I publish my ClickOnce application?

In the Publish wizard, select Folder. In the Specific target page, select ClickOnce. Enter a path or select Browse to select the publish location. In the Install location page, select where users will install the application from.

How do I install prerequisites with ClickOnce application?

Select the Publish pane. Click the Prerequisites button to open the Prerequisites dialog box. In the Prerequisites dialog box, make sure that the Create setup program to install prerequisite components check box is selected. In the Prerequisites list, check the components that you wish to install, and then click OK.

How do I publish an app in Visual Studio?

To publish your app from Visual Studio, do the following: Change the solution configuration from Debug to Release on the toolbar to build a Release (rather than a Debug) version of your app. Right-click on the project (not the solution) in Solution Explorer and select Publish. In the Publish tab, select Publish.

How do I publish a Windows NET application?

Right click on Project menu and click on "Project name Properties". Click the sign in option and select the checkbox (Sign the Click Once manifests). Go to Security >> select Check Box (Enable Click Once Security Settings). Go to Publish >> select Publishing folder location path and Save.


2 Answers

I believe you can download the correct setup program dotNetFx40_Full_x86_x64.exe from:

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

(rather than renaming the .NET Framework 4 installer as suggested by Brian). Place it in the C:\Program Files\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages\DotNetFX40 directory. I had a similar problem with the .NET Client Profile setup. In my case I was led astray to the wrong setup program by following Microsoft MSDN Help.

like image 56
DeveloperDan Avatar answered Oct 27 '22 18:10

DeveloperDan


I was having the same problem.

Rename the dotNetFx40_Full_setup.exe file that you download into the C:\Program Files\Microsoft SDKs\Windows\v8.0A\Bootstrapper\Packages\DotNetFX40 directory to dotNetFx40_Full_x86_x64.exe.

I was able to successfully publish my application after doing this.

like image 36
Brian Avatar answered Oct 27 '22 16:10

Brian