I just need to be able to open a .NET app (click once) from within an ASP.NET web page, and pass 2 string parameter to the app.
How can I do this? Any example please, with any method to do it. Thank you in advance.
This article explains how to retrieve the parameters from the querystring used to call the ClickOnce app. That should help you to figure out how to compose the URL, along with its querystring containing the parameters you want to send.
You could associate your application with a file extension and then simple generate a text file with your parameters from the web application with this extension and that would be opened by your client application.
Edit: If your click once application is deployed from a web site you could just link to that url. Depending on the click once settings the app could be started from the client if already installed.
There are two ways to deploy a click once app - so it can be launched from the start menu, and so it can be launched from a URL. Assuming you have set the app up as the URL-started one, just have a link on any ASP.NET page (or could be pure html, doesn't matter) to the click once app's URL. When the user clicks it their browser, IIS, and their local copy of Windows will all do the work to get the app launched.
Related
I couldn't find the exact answer I was looking for. I have two applications - web application built with react and desktop application built in C# Forms. What I want is if the user goes to a certain page in the Web Application, the browser should open (with or without a request) the windows application and send data, like the user's id. Could you guys give me an advice how this can be done?
For that, when installing your windows C# form in the user machine, you need to register a custom protocol in the registery.
See How do I register a custom URL protocol in Windows?
I am trying to upload video to YouTube through MVC C# application. I am following this link
Whenever I am trying to run the application I am getting below error from the Google.
Error: redirect_uri_mismatch
The redirect URI in the request, http://localhost:52271/authorize/, does not match the ones authorised for the OAuth client. Visit https://console.developers.google.com/apis/credentials/oauthclient/CCC-XXX.apps.googleusercontent.com?project=XXXX to update the authorised redirect URIs.
Here is my Json file.
Here is my Google Console Application:
Error:
Is there anything wrong ?
Thank You.
The redirect URI you set in Google Developer console must exactly match where you are sending the request from. If you notice the Port number is changing. This is because visual studio has a habit of adding random port numbers when you are debugging via visual stuido.
To specify a port for a Web application project that uses IIS Express
In Solution Explorer, right-click on the project and then select Properties. Click the Web tab.
In the Servers section, under Use Local IIS Web server, in the Project URL box change the port number.
To the right of the Project URL box, click Create Virtual Directory, and then click OK.
In the File menu, click Save Selected Items.
To verify the change, press CTRL+F5 to run the project. The new port number appears in the address bar of the browser.
How to: Specify a Port for the ASP.NET Development Server
From Google doc located at https://developers.google.com/identity/protocols/OAuth2UserAgent?hl=en_US#example
The REDIRECT_URI should be the same URL where the page is being served.
I finally saw this, put the URL for the page where I call the Google authentication, and it worked like a charm.
You need to add localhost to your authorized domain names in the Google API Console.
I have an ASP.Net C# Web Application in which I have added Windows Live oAuth authentication (I am not using the code supplied by the Visual Studio project template for oAuth). I have two return pages in my application where the user should come back after authenticating with the Windows Live oAuth Service. The reason I have two end points is to distinguish two different modes in my application based on where the user returns.
Anyways, the problem is that when I add the second URL in the configuration screen of Microsoft Windows live at https://account.live.com/developers/applications/apisettings/, the Microsoft Live page simply does not save it. Here is what I am doing:
Go to https://account.live.com/developers/applications/index
Click Application name and then edit Settings
go To API Settings
Click "Add another redirect URL"
Added my second URL and clicked save.
The second text box where I entered the URL simply disappears and my second URL does not work in the oAuth flow.
If any of you has faced a similar issue, do you have a work around? If this is something Microsoft should fix, where should I raise this bug with Microsoft?
Update: I have also tried a work around of creating two applications, so that each one has one of the return URLs, but Microsoft does not allow two applications with the same root domain URL. :(
I have the same issue.
This is not your fault, and there is nothing other than Microsoft would be able to fix it.
I have a(n) (MDI) Windows Form application. It contains two forms. One form (Measured data) controls an engine, another form (laboratory) should show my asp.net web site that has various assignments for the user to do.
How can I show the asp.net default page in that laboratory form? I'm using awesomium to make a browsing window in my laboratory form.
Doing the following
webView.LoadURL("file:///D:/school/4e%20jaar/Erasmus/ErasmusProject/Laboratory/deault.aspx");
gives an error. Probably because the asp.net site isn't online. but how can I run the site so I can see the default.aspx page?
I have on solution with three projects
ErasmusProject
ASP.NET website
SIMOclasses
SIMOForm
The problem is you cannot execute aspx files with file:/// path.
You have to execute on IIS.
So first thing you have to do setup iis if you didnt, create new web site (or use Default Web Site) to execute your aspx files, than change your link file:/// to http://localhost or something.
The URL you've specified looks like its accessing the raw file via the file system. i.e. file:///D:/.../default.aspx.
(You've also misspelt 'default' in your question!)
Can you access that URL from a browser (e.g. IE, Firefox, etc) and see the content you want? I suspect you can't and that you're missing the webserver that is compiling and serving the .aspx pages.
You should host your website first :
WebDev.WebServer /port:9999 /path:"C:\Projects\MyWebSite"
I am trying to write and application on windows where my application shud be prompted to open thru a browser link. how can I do that?
I don't know about second life, but I would register an file extension (like .MyApplication) with my application and create links to a .MyApplication-file on the web site. You an also encode special startup parameters inside that little file.