Azure Clickonce publishing - wpf

we are working on a WPF application which we want to publish as a click once smart client application.
We are able to publish the application on local machine using Visual Studio 2012 and configured it in IIS.
Now we want to upload the published smart client installer to windows Azure Virtual Machine with Windows Server 2012 and IIS 8. We cannot upload the locally published components as the URL configuration in the manifest and deployment file is that of local server. We tried to edit the entries using text editor but once we do the editing the files become unused and it shows xml parsing error when we try to install from the location.
we tried to publish the application direct to the Virtual Machine but it shows an error as Front Page Extension is needed in IIS. We tried to find Front Page extension but couldn't find an version for IIS 8 in Windows Server 2012.
Can any one help us to publish the application in Azure Virtual Machine.

The problem you are having has nothing to do with Azure per se.
In the first case (of editing the XML files), you can do that but it's best to use MageUI to do the edit, because you can then re-sign the manifests. If you just edit the files, it messes up the security on them, and they will not work (as you have found). If you want to edit them with a text editor, you can do that, but then you must re-sign them (using mage); you can create a script to change the installation URL.
Or you can use MageUI. You need to do it in this order:
Open the application manifest in the versioned folder and then save it, re-signing it with your signing certificate.
Open the deployment manifest (yourapp.application) in the top deployment folder. Change the Start Folder to be the right Installation URL. Go to the "Application Reference" tab and re-select the application manifest in the versioned folder. (I know, it hasn't changed, but trust me, you have to do this.) Save this manifest and sign it with your signing certificate.
Copy the deployment manifest from the top folder to the versioned folder. It's always good to keep a copy, so you can go backwards a version if you need to.
NOW you can copy the files to your VM and they will work fine.
In the second case, the Front Page Extensions are required if you are using HTTP to publish the application, yet they are no longer available past about Windows Server 2008(?). So don't use HTTP. Use FTP. Set the publish file location using FTP, like ftp://myserver.mycompany.com/myfolder and set the Installation URL to the HTTP equivalent of it. Then publish it. It will put the files on your VM (assuming FTP is enabled on both sides), and the HTTP link should work.
By the way, you can also host your deployment in Azure blob storage. It is dirt cheap, and you can use something like Cerebrata Cloud Storage Studio or even write your own code to publish it (which I did). This article explains how to put the files out there, what the MIME types need to be, etc. If you do this, then it will work even if you need to replace your VM or redeploy it or the VM becomes unavailable for some reason.

here is a reference to Avkash Chauhan's blog post explaining in detail How to deploy ClickOnce Application using Windows Azure Storage in very simple steps?
http://blogs.msdn.com/b/avkashchauhan/archive/2011/05/09/how-to-deploy-clickonce-application-using-windows-azure-storage-in-very-simple-steps.aspx
He also gives an code example of a windows form (using Wpf) that he shows how to deploy on azure using one click deployment.
hope this helps

Related

Creating a local environment from an existing GAE installation

I have a website that is currently running under GAE... unfortunately, I, nor anyone on the team, does not have access the local environment that it was created from.... Is it possible to create a local environment or at least get a copy of the application files and database from an existing GAE installation?
What you need is the application source code, not the "local environment".
Ideally this source code would be on a version control system (ie GIT,SVN), Google cloud platform provides free GIT repositories for your projects so you might try looking there first. There's also a tool for both Java and python that allow you to download the source of a deployed version, provided you are authenticated as either the dev who uploaded it or a project owner. EDIT: as stated by Dan Cornilescu this feature can be disabled.
As for the database info there's plenty of tools available to "export" your GAE datastore info, just consider for your project that it might be easier to do the queries manually than actually implementing this tools.
Thanks for help... But unfortunately, this code is not in GIT. Furthermore,
being new to Google hosting, I wasn't clear on my setup... My web instance is actually running within Compute Engine not Application Engine. Be that as it may, with some additional search, I was first able to find out how to browse my filesystem by accessing the VM Instances menu option under the Compute Engine section of the Google Cloud Platform interface. On the VM Instances page, it will show your instance and an option to the left side of the instance to connect with a drop down box that will allow you to open a browser window that shows the instance's file system. In addition to this, I found this link https://www.youtube.com/watch?v=9ssfE6ODpak that shows how to configure Filezila FTP client to access your server instance - very helpful. From there, I was able to download all of my site files from the var/www directory. Now, onto extracting my data... Thanks again!

DNN / WebMatrix / Localhost / Multiple Sites

It seems that DNN is undergoing an upgrade and I cannot access the forums or many of the docs. Needing an answer soon, and Google providing too many varied types of hits (none of which are helpful or most of which post to the DNN site that is undergoing that upgrade), I had a few questions about setting up DNN.
First, I am coming from Orchard. There I was able to use Webmatrix - I downloaded the web version, opened as administrator, created modules, messed with themes, etc. Using the Orchard Docs, I was able to set up a multi-tenant site and run it on local host (IIS express through Webmatrix) - this included modifying the host/config files to view the multi-tenant sites. I could then publish to my own server running IIS 7. On the server I set up the landlord site then bound the tenants with no problem.
Being new to DNN (and things not being readily available at the moment on their site), I was hoping I could get some guidance on how to set up DNN similar to what I did with Orchard.
First question is obviously whether or not that is possible (i.e., no IIS, only IIS Express (Webmatrix) on my local machine).
Here would be my other questions:
If I can run it locally, can I just download the 7.1.0 new install package, and open Webmatrix (as Admin) on the folder I unzipped it in?
Assuming I just "Run" the website, I will then set up the "Landlord" instance of DNN on the following screens, correct? (i.e., where it asks for credentials and what DB setup I can use)
Can I then go ahead and create sub-tenant sites (alias/portal)? If so, do I go about manually updating my host/config files to run those tenants (depending on the port)?
Assume all of the above is correct, do I have to "reinstall" the 7.1.0 package on my webserver, or will a simple publish from Webmatrix do (with the proper credentials in Settings)? If so, I can handle pointing to the landlord on my server and then binding my subtenants in IIS.
Sorry for the n00b questions. Thanks!
On the Download page on dnnsoftware.com, there's a link to click which will start the install process within WebMatrix: http://www.microsoft.com/web/gallery/install.aspx?appsxml=www.microsoft.com%2fweb%2fwebpi%2f2.0%2fWebApplicationList.xml&appid=106
When you create a new portal, you can specify that it uses a URL which is a subdirectory of the current URL (i.e. a child portal alias), so that you don't have to use different ports. I'm not especially familiar with IIS Express, so I would expect that you could point multiple ports to the site, and map those as different portal aliases, but not sure exactly how you could do that, if you don't want to make use of child portal aliases.
To publish a site, you should just need to push the file system and database, and setup IIS.

Problem uploading service for Silverlight SQL connection

I've found a very small sample showing Silverlight SQL connection (http://www.codeproject.com/KB/silverlight/CntDbSlght.aspx), I've tested it and it works fine on local system, also I've changed its connection string so that it shows data from my remote database, but when I upload files to my host, I cannot see any SQL data, it seems that something is broken, how should I configure my web.config?
What are CrossDomain.XML and ClientAccessPolicy.XML files? should I upload them? If so, where should they be? How should I bind my service? what am I doing wrong? I click on VS2010 publish (in build menu) and select file system, then I upload all files existing in this folder, I use C#.
If you are trying to access an external Silverlight web service from your local dev environment you certainly need a ClientAccessPolicy.XML file on the website. This tells the site services where requests can come from (normally only from the same site the SL app was run from).
Your ClientAccessPolicy.XML file needs to go into the actual root of your website i.e. 'mydomain.com/ClientAccessPolicy.XML.
*Note: You do not also need a CrossDomain.XML if you have ClientAccessPolicy (which is the SL specific one). CrossDomain.xml is an older flash compatibility file that sometimes exists on sites.

Log installer info when installing WPF App

I have a WPF (Clickonce) app. I want to find out which users are installing or re-installing the app, and probably write those info in a database for audit.
How can I do that?
The current ClickOnce deployment doesn't provide any server-side hooks for monitoring whatsoever (in fact, the "website" generated by ClickOnce publishing is just a very simple, plain HTML page providing a link/button for downloading and executing the .application or setup.exe, respectively, on the client machine. Everything else is taking place locally).
Now, depending on what you want to log (initial installations, or updates, or both) you have the following options:
Create your own website where user will register before getting access to the install/launch for the app (or maybe you just identify them by IP - depends on your needs) - this allows you to log who first installs the app, but not the automatic updates.
In your application, use the classes in the System.Deployment namespace (notably ApplicationDeployment) to access information about updates etc. whenever your application is run. You can then have your app make calls to a web service that you provide, where you can log any installation / launch action (or even other runtime information, like usage of certain features, exceptions etc).
If you are targeting .NET 4, you can have the log files go to a specific folder. Then when the user runs the application, you can have it copy it to your server and delete it, or write it to a database and delete it. Here's an article explaining how to specify where to put the log from a ClickOnce deployment. Note that it runs when you install, update, or uninstall the application.
http://robindotnet.wordpress.com/2010/05/31/enhanced-logging-in-clickonce-deployment/
The registry settings are in HKCU, so you could have your C/O app actually set the info when it first installs. You'll miss the first install log, but it will write the logs to disk after that.
Also note that the article tells you how to turn on verbose logging. You don't have to do that just to write the log to a folder.

How to update an XBAP's config file after deployment?

We have a WPF XBAP application that we want to change the configuration on the server after it is deployed. Since the config file is embedded in the deployment files, how is this possible?
For example, we want to change the database connection strings the deployed app is connected to or we want to update the WCF service binding settings that it is connecting to? We want to update the config file on the server and not have to recompile and redeploy each time.
Thanks!
In the SDK directory is a program called MageUI.exe. This program lets you create and edit application deployment manifests. You can update your config file, then use MageUI to edit your deployment manifest and import the new configuration file.
Depending on the size of your application, it may just be easier to hit Publish in Visual Studio than go through the effort of using MageUI and editing deployment manifests.
Alternately you can have your application look on your deployment server via an HTTP request for a config file (renamed to something other than .config, since ASP.NET by default blocks those files) for the updated configuration.

Resources