Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How do you recommend running a Winform from html?
 

How do you recommend running a Winform from html?

Hello,

I've written many single-file compiled winform assemblies written in C# that I'd like to let my students use. I currently do thisby putting them on my web server and then placing html links to them on a webpage. The students browse to my webpage, right-click the link for the application they want to run, download the single file to their desktop, and run the winform from there. I guess that's an example of xcopy deployment, further simplified since everything fits into a single file.

I'd like them to be able to just click on link and choose "Run", and have their client download it to a temporary directory and run immediately. Currently if they try to do this they get an unhandled exception error, although I seem to remember that once upon a time in VS2003 days this worked.

What should I be doing? I want the code to run on the client because although simple and small it is very GUI-intensive. For example, one teaches about three phase power by drawing the animated power vectors and allowing students to drag them with the mouse.

jcsquire  Wednesday, February 27, 2008 6:29 AM

This should work as you say. Users click a link, choose "run" the application moves to a temp folder and runs. What is the unhandled exception you are seeing? This may be coming from your application itself. What happens if you try this with an bare bones empty form application?

Dan Rigsby  Wednesday, February 27, 2008 10:21 PM

This should work as you say. Users click a link, choose "run" the application moves to a temp folder and runs. What is the unhandled exception you are seeing? This may be coming from your application itself. What happens if you try this with an bare bones empty form application?

Dan Rigsby  Wednesday, February 27, 2008 10:21 PM

Dan,

It's a relief to hear from you that what I think should work, should work! Thanks.

The initial exception is thrown and offers me the chance to open up a VS debugging session. The CLR debugger opens andsays "An unhandled exception of type System.Security.SecurityException occurred in (my application). Request for the permission type System.Security.Permissions.SecurityPermission failed. Break or Continue?" Break or Continue both exit the debugging session.

So its a security issue, but I'm not sure what I'm doing wrong, and I'm not sure how to find out. Any thoughts on getting more out of this? FWIW, the program is called FS1 and is at http://academics.vmi.edu/ee_js/Research/Fourier_Synthesis/Fourier_Synthesis.htm. It's pretty cool when you download it by hand and run it. Pretty sorry when you try to run it with the run command though!

Best,

- Jimj

jcsquire  Monday, March 03, 2008 3:40 AM

You can use google to search for other answers

Custom Search

More Threads

• Is the "Download prerequisites from the following location" capability broken?
• clickonce with xp theme
• Bootstrapper third party installation fails
• Setting Icon at Runtime
• Exception for some users on deployment
• Erratic detection of new versions of ClickOnce App
• Language for VS2005 setup project
• Publish Application Files
• Prevent Start menu item from being created
• Servername parameter in custom action