Deploy ClickOnce application on pc where publishing folder is not available - c#

I am trying to figure out why some of our clickonce applications (.net winforms) in visual studio 2019 are behaving differently when installing. Some applications always require the publish folder to be accessible on the network. Other applications we have can have the published files zipped up and installed on any pc regardless if its on the network or if it can access the publish folder. Is there a specific setting for the project that allows the published files to be zipped up and deployed anywhere outside of our network ?
I am currently trying to install our application in a virtual desktop and I get the error "clickonce application download did not succeed" before the install attempts to start.
In the clickonce error log it gives the publish folder path as "deployment provider url" (which cant be accessed on the virtual desktop) and says path not found.
Thanks,

Related

ClickOnce app deployed to new location still references old location for updates

I am trying to change where my ClickOnce application is hosted. I do not care about making this a smooth transition for users who already have the application installed because it is not in production yet. I thought this would be as simple as changing the installation folder url and the update location url in the Project Publish properties. Some context: The application was previously hosted on a Azure Ftp server and I would publish directly from Visual Studio. Now I want to host the application on a Wpengine server that uses SFTP. Visual Studio does not support publishing through SFTP so I have to publish to a local folder and upload through WinSCP/Filezilla. Steps I am taking to publish to the new location:
Change the Publishing Folder Location to a local directory.
Change the Installation Folder to the new wpengine directory.
Change the Update Location to the new wpengine directory.
Publish and manually upload through winscp to the wpengine directory.
When I download the setup.exe file and run it shows me the old Azure url as the "From" source as seen in the image below and it installs the latest version that is hosted in our Azure location. Obviously this is not the desired result. I even double check the manifests with MAGEUI and everything seems correct. I cannot find a single reference in my code to the old azure location either. I am not sure if this is some sort of code signing issue but I cannot for the life of me figure out how this old azure url is getting referenced.

ASP.NET project creation and loading failure in Visual Studio 2015 over mapped network drive

Firstly the solutions I have found yet in various websites, are for older Visual Studio versions.
My configuration is:
Visual Studio 2015 installed in Windows 10 virtual machine
(VMware)
A shared folder which is treated as a network drive and mapped as Z:\ in the VM
What I can do successfully:
Creation, loading and debugging Visual C# Windows Forms Application in the network drive in the VM
The same above for Visual C# ASP.NET Web Application but only in a local drive
What I cannot do successfully:
Creation, loading and debugging Visual C# ASP.NET Web Application in the network drive in the VM
Error messages I get:
During creation: Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)) error message
During loading: If a Visual C# ASP.NET Web Application project is successfully created in a local drive, moved to the network drive and then opened from the network drive in the VM, I get the error message:
Creation of the virtual directory http://localhost:2648/ failed with the error:
Filename: \\?\Z:\Test Projects\WebApplication1\.vs\config\applicationhost.config
Error: Cannot read configuration file
But the configuration file applicationhost.config is still there.
How to solve the issue for the above given configuration?
It looks like a permission issue to the file.
Double check the identity you are using for your site (in IIS) Network Services, Local System or whatever
In IIS under Application Pools under 'Advanced settings' get
the pool identity name.
Give full access to that identity for your web.config file
(even better for the whole folder application)
Do the same for IIS_IUSRS group
I have made a workaround for the issue. I have both a local folder and a shared folder for the same ASP.NET project. I always open the SLN file (project solution file for Visual Studio) from the local folder in the VM. I periodically run a process in the VM to synchronize the changes in the both folders (local and shared) so that both folders can contain exactly same files. I actually use FreeFileSync app for it. In this workaround, file merge conflict may occur if same files are edited both in the VM and the host before last synchronization. In this case I can review the changes in the conflicted files to resolve conflict. My answer is really a workaround but it works.

Visual Studio 2012 Network Shares

I emulate Windows 8 on a VM using Parallels. I store all of my developer projects on my Mac's partition for simplicity and coherence.
When I try to build an app (Visual Studio 2012) running off this network share, I get the following compile-time error:
Error 1 Error : DEP0700 : Registration of the app failed. Rejecting a request to register from file:///Z:/Users/MY_USER_NAME/Sites/App1/App1/bin/Debug/AppX/AppxManifest.xml because the files are on a network share. Copy the files to the local computer before registering the package. (0x80073cf9) App1
Does anyone know how to solve this issue? I need to tell Visual Studio 2012 that my network share is a trusted device, or at least dupe it into thinking the project is in a local drive. Is there anyway to create symbolic links in Windows?
In Visual Studio 2010, I solved this issue as outlined on this website: http://www.sehajpal.com/index.php/2010/10/how-to-solve-loadfromremotesources-error-in-vs-2010/
Thanks for the help!
This post by Gearard Boland solves this issue. Hopefully this comes in handy for anyone else developing over a network share:
Yes, it's by design that you cannot run a Metro app from a network drive and deployment from Visual Studio essentially registers the app with the system without actually packaging and installing it (so it doesn't get put into the normal install location, which is local).
You can still work with sources on a network drive, but you'll have to override the deployment location, which by default is under the project's root directory (e.g. bin\). You have several options:
You can switch from local debugging to remote debugging and set the machine name as 'localhost'. This will do a remote deployment on your local machine (thus not using the project's directory). You don't need to install the Remote Debugger tools, nor start msvsmon for this to work on localhost.
You can override the project's output directory. Right-click on the project and change the output directory to something like: $(Temp)\$(MSBuildProjectName)\bin\$(Configuration), where Temp is an environment variable pointing to your Temp directory.
If you still want normal output to live next to the sources, e.g. when you build the appx package, etc., you can override only the layout directory instead of the entire output path. For this you'll need to modify your project file directly (e.g. *.jsproj, *.csproj, ...) to add the new value:
<PropertyGroup>
<LayoutDir>C:\WorkingFolder\$(MSBuildProjectName)\$(Configuration)</LayoutDir>
</PropertyGroup>
Hope that helps.

ClickOnce installation folder URL relative

When deploying a ClickOnce application, the installation folder URL, is there a way to make it relative to the web application directory hosting it?
For instance, for local testing I publish to http://localhost:54592. However, when this web application is deployed, it could be anything from http://www.foo.com to http://www.foo.com/MyVirtualDirectory
I would like the path to find the installer in its current location, and the application after installer has completed to reference the web app host, not the development URL.
Platform: Visual Studio 2010, .NET 4.0, and C#.
This works out of the box if you stick with *.application as your application source. You just need to pick a folder inside your web application to publish your ClickOnce application, and the application is available from this address under your application.
For example, if copy your site to C:\inetpub\wwwroot\mysite and copy the ClickOnce to C:\inetpub\wwwroot\mysite\myapp with MyClickOnce.application inside the ClickOnce folder.
Then you expose your website as http://example.com and the ClickOnce application is available under http://example.com/myapp/MyClickOnce.application.
In case of setup.exe you need to recreate the manifest after you publish it to the destination location. This is done with mage.exe.
In the Options dialog, the Manifests tab, you can check the box that says "Exclude deployment provider URL".
Then provide the URL to your user for the installation based on where you put it. When they run it, it will create and save the URL where they got it from, and always look there for updates.

How to use ClickOnce to deploy my C#(4.0)Visual studio 2010 windows form based Application?

We are developing C# 4.0 windows based application using visual studio 2010. Now we want to make an installable version of the exe using clickonce to deploy our application. I am new to .NET platform. So, please give me a step by step procedure to use clickonce to deploy my application.
While following steps :What should i need to given in Installation Folder URL Box(2 nd text Box):
Here is the break down of the two paths in this wizard
Publish Folder - Where should the Publish process put the ClickOnce deployment package
Installation Folder - Where will users of the application go to install the application from
Often times these are the same location. For example when I deploy ClickOnce applications internally I publish to a network share. This is the same place where users go to install the application.
One scenario where they would be different is when the users install from a web location. In that scenario you'd often have a publish folder which was a network share or path on the local computer while the installation folder was a web site URL

Categories

Resources