Deploying a Win Form via Web Server
I'm trying to setup a web server on my intranet to deploy windows forms applications. I've written a VERY simply app, the classic "Hello World" and have successfully tested launching the app from my local machine (ex. http://localhost/helloworld/helloworld.exe)
When I move the app to the actual intranet web server (Win NT 4, SP 6, IIS 4, .Net Framwork SP2) and try to run the app by navigating to the proper URL (ex. http://appserver/helloworld/helloworld.exe) from my pc (Win 2000 SP2, .Net Framework SP2, IE 6) I encounter problems. I've use the .Net Framework Configuration tool to add a Code Group, giving full trust to my application server's URL.
After navigating to the URL, the application server shows the executable file as a process, so it is being loaded. On the client, I do not get any security exceptions, but the form never displays.
Any info would be appreciated!
I have done a bunch of no-touch deployments and had to do some troubleshooting as well, though I never had this particular problem. So if you don't mind me asking a really basic question, just to see where to start...
Can you see if the exe made it into the gac on your local machine?
Just in case...that is tucked in the local settings/assembly folder/dl.
I am assuming that since this is a very simple app, all you have to deploy so far is the exe, right?
julie
Can you post the code for this app ?
Also what exactly are the problems you've referred to ?
The difference in behaviour can probably be brought down to your localhost falling into the intranet zone and the appserver falling into the internet zone on the client you're testing. This will result in it giving different permissions.
Depending on what options you've chosen in your Code Group the application might still be restricted to the zones permissions.... there's a check box in there that does this.
Here's what I've tried:
I've adjusted the the Framework Configuration (temporarily) to grant Full Trust to All Code.
-This did not work.
I've looked at the gac download cache using gacutil /ldl.
-The app is not loaded. It is also not loaded if I run the app from localhost.
Everything seems to be working correctly on the server.... any other suggestions?
The code for the app is trivial, simply a single, empty form, built into an executable.
(Thanks for the info so far.)
Here is where I'm currently at...
After switching my appserver to Win 2000 (and IIS 5) and creating an ASP.NET web project that called the executable from within the same directory, things worked.
If I change the link in my ASP.NET project to point to another directory I get the same results as described above.
Example: link in web project (http://appserver/applications/main.aspx) calls executable (http://appserver/helloworld/helloworld.exe) --this fails. Changing the url to http://appserver/applications/helloworld.exe and copying the exe to the same directory as the ASP.NET project works.
Is there a way to call an exe from another directory?
What I thought was working, isn't. The exe was actually loading from \\localhost instead of \\appserver, so it appeared correct. Back to square one.
Just a suggestion, did you try going through one of the walkthroughs available on the Articles page under Deplyment? If not, I'd go try one of them. Check out the articles at <a href="http://windowsforms.net/Default.aspx?tabindex=3&tabid=40#Deployment">http://windowsforms.net/Default.aspx?tabindex=3&tabid=40#Deployment</a>.
If you still can't get an href .exe working, try to get a Windows Forms control to load in the browser. If this also fails, it could be that your install of the .NET Framework is broken and the MIME filter we install for IE which is responsible for launching managed code isn't being invoked.
Internally, we realize how important the deployment scenario is and also how much of a pain it can be to debug these problems. There are many points of failure and virtually no debug information available when something goes wrong. Deployment is one of the areas we're spending alot of effort on for future releases.
- mike
I got the deployment model to work using a loader app, reflection, and using [Assembly].LoadFrom. I would like to avoid the loader application altogether and launch directly from a url... but this works in the mean time.
Thanks to all those who provided info.
I ran into this problem before. The problem is that IIS has a new tool that prevents users from hitting executables in Virtual Folders. I think this was added in one of the Services Packs for Windows and/or with the IIS Lock down tool.
Go to Control Panel + Add/Remove programs and see if you have installed something called "IIS URL Scan Tool"
There is information about this tool at:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/tools/tools/urlscan.asp
You can modify the URLSCAN.INI file to let it accept requests for executables. You might need to restart IIS for the changed to take effect.
Change lines:
; Deny executables that could run on the server
.exe
To:
; Deny executables that could run on the server
.was_exe
Hope this helps.
Hector