I have a webpage in ASP.NET.
And I have an .exe application which created using C#.
First, the user have to download the .exe application and should copy it to the C:\.
That I can give the instruction in the webpage.
Using a link in the webpage, I need to open that particular .exe application.
I tried the following Code:
using System.Diagnostics;
......
......
......
ProcessStartInfo info = new ProcessStartInfo(#"C:\app.exe");
Process.Start(info);
This working fine locally, but when I uploaded it in the webserver, I got the following Exception.
Exception Details: System.ComponentModel.Win32Exception: The system cannot find the file specified
Then I searched in Google and found how the iTunes launches from the website.
Like from the following link.
Launches iTunes.exe from here
Then I tried to open the iTunes using the following link.
Open iTunes
It worked perfectly, but I tried the same with my .exe application, it didn't open and at the same time it showed the following error.
HTTP Error 400 - Bad Request.
So can anyone guide me to open my .exe application from my webpage.
And if the .exe is there in Bin folder on server, then how can I go about it.
Thanks
This
ProcessStartInfo info = new ProcessStartInfo(#"C:\app.exe");
Process.Start(info);
starts a new service on the server not on the client computer. You get an error message because there is no "C:\app.exe" on your server.
You cannot launch an application on local computer from asp.net server application.
Itunes is using a "protocol handler", read How does the Apple iTunes web site launch the iTunes application on my computer when I click the blue "Launch iTunes" button?
Related
I use to be able to connect to my Test Server source code via a Network Drive.
I have mapped it to letter K.
My computer (since last restart) won't run the IDE properly, and always displays the error ASP.NET runtime error: Failed to map the path '/'. at the top of the .aspx file.
I have tried the following:
Starting Visual Studio as administrator
Ensuring that my user has FULL rights to the source code folder (both from the network drive and the server)
Given Network Service and Network users on the server full control over the test server source code folder.
Changing the AppPool identity on the test server to use my username (as I am administrator on the server as well).
Creating a new website project and mapping it on another network drive (Still doesn't resolve the problem).
When I access the test server via my web browser I receive no errors. So I know there is no errors in my code.
If I open the IDE on the server using remote desktop then it works with no errors.
I can live with the error on the top of the page, however when I try to access a DataSet or a Control on the page then it doesn't register the control or function as an existing function.
I am now at a complete loss as to how I am going to fix this.
Any ideas on what could cause this issue and how I could fix it?
I found a work around to the problem by opening the code directly using the IIS on the server.
What I did was click on File -> Open Website, in the open dialog, on the left, I clicked "Local IIS", found my TestServer and clicked open.
I have a website in asp.net with VB, and I have a link to a medical program that is installed in PC, when I click the link I want to execute the .exe for this program. I found this code but it´s works only when my project is locally:
System.Diagnostics.Process.Start("C:\Windows\System32\MiProgram.exe")
I also tried with this code:
Dim OpenDoc As ProcessStartInfo = New ProcessStartInfo
Dim stPath As String = "C:\Windows\System32\MiProgram.exe"
OpenDoc.FileName = stPath
OpenDoc.Verb = "open"
OpenDoc.WindowStyle = ProcessWindowStyle.Normal
Process.Start(OpenDoc)
Both codes works locally, but when I get my project to the web, does nothing
I also read that I can enable de IIS Service, I follow the steps of this page, but is not use to me.
Is there any solution to this problem?
I accept suggestions.
Thanks.
Unfortunately, it is not possible to run a program on the client from server-side.
There is already some discussions about that, here is some links :
How to execute an application on the client from a website?
Run an exe in client machine from a website
Executing exe on client side using C#
You can do this with a work around..
You create a running Windows Forms application, on that application you host a wcf services, check this link as sample.
Expose a method like `RunApplication' put the same code their, where you can call it from your website, this will 100% work.
You can try by implementing this settings:
In IIS 7/8 go Control Panel / Program And Features / Turn Windows
features on or off, and check all items from: Web Managment Tools,
(it's include: IIS Managment Service, II 6 Managment Compatibility)
I have created a simple chat application following the Getting Started With SignalR URL. When I run and test the program it is working wonderfully fine.
I tried to create a simple client out of this application with a simple HTML and required SignalR.JS package installed as instructed in the second part of Self Hosting SignalR the article where a html and set of JS files try to access the chat application hosted in IIS (one developed following the Getting Started URL.
I am getting the signalr/hubs 404 Not Found error when firebug is used to trace and is not working. Can someone please help me understand what change we need to do to get the chat server working from the JavaScript (and any other) client application.
My chat server is hosted in my IIS as srserver (virtual directory) and the client again is hosted in IIS as srclient (virtual directory) . It is not Cross domain but still not able to get this working.
I had similar problem , that i was missing in the auto generated hubs js (visual studio generates it automatically but when in production environment i had to place it there)
you can generate it using the following command, and than place in the production environment :
signalr ghp /path:[path to the .dll that contains your Hub class]
follow the full instrutinos here
I have a web app which is working fine in IIS 6 ex:loading page, loading doc and excel file perfectly. recently I moved the same web app code ti windows server 2008 R2 IIS 7. Now it is not working correctly, it is browsing but it is not loading the Excel and doc files properly.
Additonal Trouble Shooting Info
Adding to the above when i checked the event viewer i am getting below information
The description for Event ID 0 from source Quotes cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer,
the display information had to be saved with the event.
The following information was included with the event:
Class : GetFile Method : Page_Load An unexpected error has occurred
while locally saving the requested file. Error details - Object
reference not set to an instance of an object. the message resource is
present but the message is not found in the string/message table
could you please help on this. how to find the root error and how to trouble shoot further.
This is a long shot but we had an issue where we used to parse data Excel worksheets using Microsoft.JET.OLEDB.4.0
This started to throw errors on an Application hosted within IIS7 but was fine in IIS6.
Our fix was to:
Right click the Application Pool being used by the Web App
Advanced Settings
Set Enable 32-Bit Applications to True
If that fails to help, why not try to use the Classic .NET AppPool with your application, as opposed to the DefaultAppPool (which I am assuming is the case).
Good luck!
I have MVC4 which is running fine my local IISExpress. Today My admin created brand new Dev server and created new web application under default website. I have published same code into that webapplication folder. when I typed http://dev.company.com/iapps/vol it blows up 500 - Internal server error
How can I troubleshoot this?
There are like a million things that could be wrong (missing DLLs, file permissions, DB access, etc)
The easiest way start debugging the problem is accesing the site from inside the dev server. This way IIS will throw the error to the browser because it's local.
Try registering ASP.NET.
From Windows Explorer, browse to:
C:\Windows\System32
Find cmd.exe, right click on it and "Run as administrator"
Then in run this:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -i