How to host updates for Clickonce applications? - visual-studio-2010

When using Clickonce deployment when the publishing wizard in Visual Studio asks if the application will look for updates online (and if so, to provide a url) what exactly should I point to? Do I simply host the contents of the /publish folder on a server, and enter the url to that folder? Then just update the online /publish folder when I release updates, or should the url point to something else?

Normally the best way to host a ClickOnce Deployment is to deploy from a webserver.
On the first page in the Publish Wizard where it asks Specify the location to publish the application leave this as Publish\
On the second page where it asks 3 options select the top one marked From a Website and type in the url of the web server where you want to deploy from (this needs to be the full uri inc virtual directory).
Then complete the wizard.
What you should end up with is a series of files in the Publish directory, one of which will be publish.htm
You can then upload these files as is to your webserver and give out the link to the publish.htm file to let your users start the installer.
If you re-publish just keep the settings the same and you should roll out a new update to all those people who used the publish.htm link to install.

Related

Why do I not have an option in VS2013 to publish to a local server?

I have a web application in VS2013. I click the Publish option and I get the following screen:
This doesn't match any of the examples I've seen online where I should have the option to create a new Publish profile and specify a local server. Anyone have any idea how I got this Publish dialog vs. the one in all the docs? And how do I publish to a local server (not my computer, but a Dev server in-house).
Click on "Custom" and give the publish profile a name.
It will progress to the next screen (pictured below) where you can fill in the details.
The options you can pick from include Web Deploy, Web Deploy Package, FTP, and File System. You probably want either FTP or File System for your Dev server (assuming it's either got an FTP server or is mounted on a network drive.
I think the difference between the documentation and this one is just due to it being a different version / SKU.

Visual Studio: Pre-Build add contents of directory to project

I have the following setup:
Main Website - MVC 3 project, to be hosted on www.domain.com
Intranet Web App - MVC 3 project, windows authentication, hosted on admin.domain.com, which is only accessible from within the local subnet.
CDN Website - A simple web app that merely serves images to both of the above. It will be hosted (publically) on cdn.domain.com, when we go live. I have set up a local project to mock the CDN during development.
I've written a business layer that allows users in the admin panel to upload images, which are then physically saved to the CDN path that's configured (currently on the local machine i.e. C:\Code\SolutionName\CDNProject\images). The main website then uses the same business layer to find and distribute the images via http://cdn.domain.com/images/. http://cdn.domain.com is currently set to http://localhost:55555, while we develop.
Whenever an image is created via the admin panel, it is physically created on disk. Each developer works on his own machine, we we want to be able to check these files in to TFS, for the time being. As you might have guessed, adding files to the file system does not automatically reference them in the project:
I thought there may be some way to reference these images as resources, or set a directory to a "content" directory of sorts... but I can't find anything.
Some developers work remotely via VPN, and do not have access to the local network (only TFS), so a network path is not an acceptable solution.
I thought I might be able to set a pre-build event up, to add all files in a directory to the project?
There is no very easy way to do that. There are a few ways to think about:
1) Write VS adding which adds new files to project (via DTE - starting point). Find out how to automatically run this VS addin on Pre-Build step. Install this addin to your developers machines.
2) Extend your admin logic to automatically check-in the uploaded files to TFS via TFS API
3) try to apply more sofisticated techonologies like this one: T4 Tutorial: Integrating Generated Files in Visual Studio Projects
Hope that helps,
Visual Studio project files have an XML syntax. Project file properties can be modified in a simple text editor (files added/removed, etc.).
You can create a script to open your solution, and before actually opening the solution, you can scan that directory and "inject" the files (with the appropriate XML tags) in the project files.
I don't think you can add this as a pre-build event because the project files are already loaded at that point, and you cannot modify them while they're used.

Unable to publish website from Visual studio 2010

We have a an ASP NET MVC website solution which only one out of three devs on the team is able to publish to the live server. When I, and another colleague, attempt to publish the site from VS 2010, the output window will display an error:
Unable to create the Web site
'\blah'. The path '\blah' does not
exist or you do not have access. The
specified path is invalid.
This points to a logon issue which my account, but the developer who can publish the site is a member of all the same user groups as me. As a long-shot, we gave Everyone full access to the folder, but this did not resolve the problem.
Can anyone suggest a more detailed way to try and figure out why we cannot publish the site? There must be a permission set somewhere that is allowing my colleague to publish the site from Visual Studio.
I had this problem and racked my brain trying to resolve it so I wouldn't have to copy the publish files to a remote server manually. I spent a great deal of time actively trying to get this to work.
Here's how I solved the problem: I went to File>Open in Visual Studio 2010 Express and navigated to the remote server (\\255.255.255.255\folder1\folder2\folder3 and so on). Right away I was challenged for a User Name an Password. I entered the credentials for the REMOTE server, checked the box to 'Remember my credentials'. I immediately tried to publish and voilá - it worked like a charm.
I hope this saves a lot of people a lot of time.
I had this issue - certain members of our team were able to publish directly from VS2010, whereas for some reason I was always getting permission denied errors, even though we were all able to connect to the server we were trying to deploy to. I fixed it in the following way:
Go to "Server Explorer".
Right click "Servers" and go to "Add server..."
Type in the name of the server you are trying to connect to, and then click on "Connect using a different user name..." - put the credentials for logging into the server in here.
Click OK and wait for it to add the server.
Now try and publish to that server and it should be ok...
Not sure why I needed to do this and others were able to deploy without adding the server in this way... remains unexplained.
According to the comments below:
You may need to restart Visual Studio in order for this to take effect.
This should also work for newer versions of Visual Studio
Faced the same problem today. In my situation I had to close VS2010 and open it NOT as an admin and it worked without any problems.
This got me for a long time...Go to Project - Properties and select the Package/Publish Web tab. Under the header "Web Deployment Package Settings", there's a ellipsis button that you can use to map to the location you want to publish. You will be asked for your credentials during that process.
Are you using web deploy (right click and choose Publish)?
Have you tried copying the ProjectName.Publish.xml file from the one machine where you can publish to the other two machines? The login credentials for publishing are saved in this file.
In IIS can you check to see that all users/groups are listed under Management Service Delegation in IIS Manager? It is listed under the Server node in IIS. Alternatively you can give all administrators access by clicking on Edit Features from the side-menu and checking Allow Administrators to bypass rules.
You could also check under IIS Manager Permissions for the individual site to see if the person that can publish is listed under there and you are not.
I just recently setup MSDeploy access on my server and found the following two tutorials helpful:
http://william.jerla.me/post/2010/03/20/Configuring-MSDeploy-in-IIS-7.aspx
http://code-inside.de/blog-in/2011/04/03/howto-setup-of-webdeploy-msdeploy/
I have also found that mapping a drive to the UNC location can be a work around.
#soupy1976's solution has also worked for me.
I can not explain why one day it will work and one day it won't
Frustrating....

Publish ClickOnce app to local machine and then upload?

I'm publishing my app with ClickOnce to a web server, with the install from a web page option. But I usually have to try it like 5 times before it works because I'm using a not very good server, and it is a lot of files that are being uploaded. Also maybe since there is no bandwidth limit on the server that's the way they say "hey, easy with the bandwidth". Whatever.
But now I've been trying to publish for like 2 days already and I always get an error, always something with the server. So is it possible to publish to my own PC as if it were a server and then upload my files manually, without having to manually create a manifest and stuff like that?
Yes. Set the publishing file location to a local directory, like C:\MyApp. Then set the installation URL to the URL the users will use to access it on the webserver. Publish it.
It will publish the files to the local folder.
Copy or FTP the new versioned folder up to the server first. This is under "Application Files", and will be something like yourappname_1_2_3_4 where 1.2.3.4 is the version number (for example).
Next, copy setup.exe, publish.htm (if you're using it), and yourappname.application to the root of your deployment folders on the server, overwriting the ones that are already there.
The version the user runs is determined by that deployment manifest (.application file) in the root of the deployment folder, so the versioned folder will not be accessed until you put the new deployment manifest in place. That's why you want to do the versioned folder first. Obviously if you put in the new deployment manifest and the folder it wants to use is not there, you'll have a problem.

Is there a better way to deploy web applications using Visual Studio 2010?

I am using Visual Studio 2010 and IIS 7.0 .Currently when I want to deploy an website to my web server I follow these steps -
1.Right-click on website and say publish..to get the entire site copied to a local folder.
2.Next using filezilla just ftp the copied files to the web server.
The problem is I have to deploy entire website all the time since I can't keep a track of the changes. Although I do find my way easier and without problems. I dont want to a whole lot of configuration and deployment packages unless it is really worth it and also relatively easy to do. Is there a better way I should do the deployment ? Any suggestions are welcome !
You could use the Web Deployment tool. It needs to be installed on the webserver too and can even take care of publishing a sql server database.
http://www.iis.net/download/WebDeploy
Do NOT use the Web Platform installer to install this package.
You can just right click on website and Publish Web Site; the Publish Website Wizard opens. You can click the ... button to browse on the Target Location textbox and choose FTP over in the left hand side, then put in your FTP credentials.
You can tick 'Allow this precompiled site to be updateable' so if you need to make minor changes (such as scripts, css, or html) but I don't know how reliable that is.
Good luck!
Scott Gu just published an article about the Deploy Features in VS today:
http://weblogs.asp.net/scottgu/archive/2010/07/29/vs-2010-web-deployment.aspx
Personally I use Dispatch for ASP.NET. Works well for me. It only uploads the files that have changed and can check for files that are missing locally or on the server.
http://dispatchasp.net/
If you are using the Publish Wizard then you have no choice but to deploy the whole site. There is no way for the wizard to look at the files on the server and know definitively if the file has changed or not (it could look at file size or something, but that's not 100% guarantee of no change and FTP doesn't offer an easy way to do a checksum algorithm).
Other then that, do it the way you would do it on any other language/tool. Just manually FTP the files you've changed. Of course, this means you have know which files are side-affected by your changes. And if you're not confident as to what files you've side affected.... publish wizard is your friend :)

Resources