The existing published deployment does not appear to be a valid deployment manifest - wpf

So I was able to publish my wpf application using click once without any problem for a couple of months. But yesterday when I tried I got an odd looking message.
When choosing Yes option the publish stops and fills error list with those errors:
I tried searching online but without any success.

I resolved this issue by unchecking the passive mode check box when prompted for the ftp credentials

This issue started happening to me after I upgraded to Visual Studio 2019 16.7.3. I also updated my application from .NET Framework 4.7.2 to 4.8. (Although I doubt that's the issue, I did not revert to 4.7.2 to test it.)
My solution was to publish to a local folder and then upload those files with a separate FTP application (e.g., FileZilla). Upgrading my existing ClickOnce app worked fine.
Details: In your application's Properties page, select the Publish tab. Change the Publishing Folder Location field from "ftp://whatever" to "C:\publish-MyApp." Click the Publish Now button. VS will create the files pretty quickly. Next, use your FTP application to upload the contents of the C:\publish-MyApp folder to the existing installation folder on your server. This overwrites the existing setup.exe and MyApp.application files and adds a new folder (e.g., MyApp_1.2.3.4) in the Application Files folder.
(One side benefit of this method is that it's faster to publish because FileZilla is a lot faster at uploading than Visual Studio.)

Related

When publishing how to have only the latest version

I have a WPF application which i publish in intranet, the thing is i published the application 20 times till now, so i have 20 folders and the size of the build becomes more, i manually delete and leave only 2 latest versions, but is there a way to only have latest version to be published?
Right now i save in folder and then copy to inetpub\wwwroot, but if i had to send the files directly using Visual Studio, i have speed issues due to weak intranet lines in some branches.
but is there a way to only have latest version to be published?
You are already only publishing the latest version each time you publish.
The older versions don't magically disappear when you publish a new version though. You'll have to remove them manually one way or another:
Can ClickOnce be configured to delete off old published directories?
Actually when u publish only current and previous version source are there in application files,Visual studio publishing tool doesnt delete the older versions in published folder ,so we are seeing too many folders .Just delete everything in publish folder before publsihing and you will have only two folders current and previous version.

ClickOnce deployment on Windows 10 is not copying an asset folder to the client computer

I recently started having an issue with an Windows Forms application that uses ClickOnce to deploy, in that, when the install completes, it is missing a data folder that contains a zip file and some *.xlxs files needed for the application to run.
This application has been deployed using ClickOnce over numerous updates for the past few years without any real problems. This issue just started happening around the end of December 2017.
I am using VS2017 for the builds. I am using .Net Framework 4.5.2 and I am developing on Windows 10 Enterprise, v1709, build 16299.192
When I publish the application, whether to a local folder on my Dev computer or to the Web Server we use for customer access to download the application; when I look at the published files an I view the Application Files folder, in the folder for the latest version, I can see the Data folder and it has the files as expected.
However, when we run the installer, it doesn't copy that Data folder to the C:\Users{username}\AppData\Local\Apps\2.0\Data\MXTKKEP7.G7K\8W0HCWQ1.AT0\conf..tion_97fe94acfe5f3262_0002.0001_27630dc69b57826e\Data\ location.
When I then run the application, I get this error;
If I manually copy the Data folder to that location, the program runs as expected, without the error.
I get the same problem, whether I click on the *.application file or right-click on the setup.exe file and select "Run as Administrator".
Is this some kind of new security issue because the Data folder has *.zip and *.xlsx files in it?
Has anyone else ran into this kind of problem?
Check include state for you zip and xls files. Goto Publishing project property > Publish > Application Files > And set for you files in publish status column.
If they are missing please check this article:
[To add files to the Application Files Dialog Box]
https://learn.microsoft.com/en-us/visualstudio/deployment/how-to-specify-which-files-are-published-by-clickonce

Click Once: Auto Select Publishing Location and Installation URL based on Config(Debug,QA,Release)

I would like to be able to publish from visual studio. I am able to do this
I have different configurations for Debug,QA,Release. I am using config transforms and they work fine.
ISSUE: when I publish the I want the Debug, QA,Release to be published to their respective folder example E:\Application\Debug and so on. I am able to do this by changing the Publishing folder location and Installation folder location manually. How can this be such: f I change the configuration these locations are selected automatically. So when I need to publish a particular version -> and all I need to do is
change the config
press the publish now button.
Thanks!
The only possibility I know of would be to use a Build Server and build if the Source code changes (probably seperate branches) and have build definitions for each case.
This would mean that you would have to have a kind of source control (Git, Mercurial, TFS) for the Project and the resources to run that kind of service or use a Service on the internet.
Build Server for local installation:
TeamCity
Team Foundation Server
Build Server via Internet:
VisualStudio.com
(Those are the onse that come to my mind because I have used them before. There are much more available)

Two ClickOnce Windows applications on the same server

I have an issue installing two ClickOnce Windows applications on the same server. I have published one successfully. I have a requirement to install this same application on a different website in IIS. This is a copy of the existing application with slightly different functionality (not important). After I publish and try to install it, I get the following error:
Unable to install this application because an application with the
same identity is already installed. To install this application,
either modify the manifest version for this application or uninstall
the preexisting application.
I've tried changing the assemblyIdentity version number and name in the Properties -> app.Manifest, tried changing the Assembly name in the Project properties, tried clearing the manifest cache and none of these worked. I realize that this is the same application that I'm trying to install on two different websites on the same server, but what needs to be changed so that it will install correctly?
You need to change the Product Name of your application's deployment. This is the application name stored in the deployment manifest file. Making this name different between your 2 instances will allow you to install both of them at once. If setting this through Visual Studio, this is under the Options button on the Publish tab of your project's properties window.

How to remove previous versions of an offline clickonce application

We have an net 4.0 winforms application that we publish with clickonce to the client pc's. The installation is about 80 MB. The application is offline available and the update occurs in the startup of the app using
ApplicationDeployment.CurrentDeployment.Update
Each time we do an update of the application everything works fine and each client gets udpated. However the application cache keeps growing in size... We noticed that more then two versions are kept in the LocalAppData folder. The size of the clickonce installation folder is more then 1GB.
ClearOnlineAppCache works only for online applications and we don't find any information to clean the LocalAppData for offline application.
Is there any way to manage previous versions of our application in the LocalAppData folder from our client pc's?
Update:
We removed our custom update code and used the update mechanism of the Clickonce framework. Now old versions are removed properly and only two versions are kept in LocalAppData. I have still no idea why all versions are kept when we update through the custom update code.
I've seen this issue before, but I clarified with the ClickOnce lead at Microsoft before answering.
It keeps two versions of the deployment plus there are extra folders for each assembly. When processing an update, ClickOnce figures out which files have changed by comparing against the assembly it has already cached, and it only downloads the ones that have changed. The deployment folders have hard links to the assemblies in the separate folders. So you might see additional files, but it's not actually the file, it's a link to the files in the assembly-only folders. Explorer will show it as a file, but it's not. So unless you're running out of disk space and are just concerned about the folder size, be aware that the information reported by Windows Explorer may not be accurate.
There is an answer to this problem here
I wrote a function to clean old ClickOnce versions in the client side.
In my machine I've freed 6Gb of space. I don't want to even know the total space used by old versions org wide...

Resources