I want to publish my LightSwitch application as both a 3-tier desktop app and a web app. Is there any way to do this in a synchronized manner? And are there any commands that would allow me to do checks before trying e.g. OOB actions in a web app? Basically, I can't find anything on the web about deployment in both Desktop(OOB) and web. I want to know if there is any knowledge on this.
Asked
Active
Viewed 939 times
1 Answers
3
You should be able to detect if your lightswitch app is in-browser or out-of-browser, using the AutomationFactory.IsAvailable
property, which should return false for in-browser, and true for out-of-browser.
With regard to publishing to both Desktop and Web, I think you can just run the publish wizard for Desktop so that it produces the necessary files in the ../Publish
directory, save them somewhere, then re-run the publish wizard for the Web. As long as you are publishing the data to the same location (provided you want shared data between both applications), then this should work (however I haven't tried it so no guarantees).

RichardC
- 794
- 4
- 13
-
I am going to be "fooling" with this over the day today (if I can get my IIS server, that is), but I now remember seeing the `AutomationFactory.IsAvailable` trick before, thanks! I'm marking this as the answer but will report back when I have tried the multiple deployment and can confirm that it works. One thing that comes to mind as an additional sticking point is the automatic versioning that increments every time you deploy. If this number is different I can see a problem happening, but this is something I will have to test out! – DTreth Mar 08 '13 at 15:24
-
I'm pretty sure the version will increment each time, but I'm not sure why that would cause a problem (unless you're using that for something in the application). You can always control the major and minor numbers, so unless you utilise them instead to check for 'same versions'. When deploying, you'll be doing it to 2 separate locations so the auto-update checks shouldn't cause an issue either. – RichardC Mar 11 '13 at 10:14
-
Soupy, I have tried this, and there are a few gotchas, however, it in large part just works as you'd expect. Regarding the version number, if you really was to make sure the numbers are the same close VS after deploying and DO NOT save the three files it wants you to (the common, client and server AssemblyInfo.cs files). Then reopen the solution and redeploy withe other configuration. This should work to push out the same autoversioned number both times. I will reply to your comment in full once our IT has the domain joining figured out because I'm being kneecapped with that issue right now. – DTreth Mar 14 '13 at 19:31
-
I was browsing around SO and found this. I should have replied, so I will now! It all works just great with Active Directory and the double deployment. The builld number gets incremented but this wasn't ever a problem so I have even abandoned the close VS and re-open step. – DTreth May 20 '15 at 21:18