run .msi setup file after accessing web site from server to client - c#

I have created a web application in ASP.NET, with C#. I am getting the following message in my browser window when accessing the application:
---------------------------
Windows Internet Explorer
---------------------------
Stop running this script?
A script on this page is causing Internet Explorer to run slowly.
If it continues to run, your computer might become unresponsive.
I researched into the problem and found the following link, which is proposed as a solution to this problem:
http://support.microsoft.com/kb/175500
I want to execute this setup when a client accesses the web site for the first time. How can I run this setup on the client side?

It is not possible to fully automatically run some program from a website as #cHao said, this is what all browsers prevent.
But you may look at ClickOnce deployment, it allows for very fast and easy installation of your program literally in one click.
http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.80).aspx

Related

Blazor server app running directly via exe not showing https localhost in cmd window & SQL data access not working. Works fine in VS debugging mode

I have a Blazor server app, which is exported into some files and an exe upon publishing. In this setup, I have 2 machines. Machine A which is being used for development and is hosting the SQL server express instance.
Scenario 1:
I run the app on Machine A. I get the following screen.
Next I open chrome and open either of the 2 localhost links and the intended website loads with the data being queried from SQL server and displayed on webpage.
Everything works as intended.
Scenario 2:
With the same setup as above, since the cmd window in indicating an active web server running, I tried to open the website on my phone using the Machine A's IP. It didn't work. This is problem 1. Getting this to work on other machines.
Scenario 3:
In this scenario, I tried to run the app on machine B with the SQL server still running on machine A. They are both in the same network. Upon running the exe, I get the following:
I am now not getting the https option. Which doesn't bother me too much if it worked. When I try to run the app, I get this new line added to cmd window.
When I try to open the localhost 5000, the website loads but no data is fetched from SQL server. So i guess i am not able to access my SQL server on machine A from machine B due to some authentication issue.
I do not want to use IIS unless there is no other way. this is an internal tool so security and elegance isn't an issue. Ease of use is the most important goal. Running the exe direct is easiest for the end user.
Thanks for any suggestions.

Selenium webdriver test 100% pass locally, 100% fails on VSTS server

currently in my 2nd week of trying to work out why a certain test runs perfectly locally but fails when being kicked off by a VSTS agent.
Program flow:
Select an row from a table
Click Verify button
CSS overlay darkens the screen, spinner in the middle
Toaster pop up in the bottom left saying Verification starting
About 1.5 minutes of time passes, spinner spins
CSS overlay removed
Toaster pop up bottom left, successful verification
I have screenshots and debug output on everystep of the way and the failure is at the "Waiting for CSS overlay to be removed" stage. It times out waiting for it, now matter how long the timeout.
Screenshot shows the CSS overlay and spinner still spinning even though the verification process completed successfully. Its almost as if it's stuck in time.
Scenarios and results:
Run from Local Visual Studio - PASS
VSTS Agent - FAIL
Manually run on VSTS Agent by remoting in and passing the exact commandline as the build - PASS (This is what infuriates me!!)
Downgrading / upgrading Webdriver - no difference
Headless / full mode - no difference
Using different types of waits - no difference
Waiting for Toaster pop ups instead of CSS - no difference
One thing to note from the documentation:
Agents that are configured to run as service can run Selenium tests
only with headless browsers. If you are not using a headless browser,
or if you are running UI tests for desktop apps, Windows agents must
be configured to run as an interactive process with auto-logon
enabled.
The fact that you also tried to run Headless might mean that even if you are running as a service and still got errors, this might not be your issue. In some cases, I have had issues with remoting to the machine messing up future test runs or video recording by logging out the user or changing the screen resolution. The documentation continues about ways to prevent this:
If you use Remote Desktop to access the computer on which an agent is
running with auto-logon, simply disconnecting the Remote Desktop
causes the computer to be locked and any UI tests that run on this
agent may fail. To avoid this, use the tscon command on the remote
computer to disconnect from Remote Desktop. For example:
%windir%\System32\tscon.exe 1 /dest:console
In this example, the number '1' is the ID of the remote desktop
session. This number may change between remote sessions, but can be
viewed in Task Manager. Alternatively, to automate finding the current
session ID, create a batch file containing the following code:
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
%windir%\System32\tscon.exe %%s /dest:console
)
Save the batch file and create a desktop shortcut to it, then change the shortcut
properties to 'Run as administrator'. Running the batch file from this
shortcut disconnects from the remote desktop but preserves the UI
session and allows UI tests to run.
I'll answer my own question: We created a new agent which was an auto login. We watched the test run and pressed F12 and there, in the console, was an error.
It was trying to trim() on the username, the test account looked like it had a username but I guess it didn't really. So the system, when run by the agent, was throwing an error and not handling it.
Handled the error and everything went through swimmingly. Very long and frustrating road to get to here! Hope this helps someone in the future.
Please check Azure DevOps Hands-On-Labs to get started with Automating Selenium Tests in Azure Pipelines. Hope this helps...
VSTS will run Selenium and the browser as local admin. The browser will refuse that when started in sandbox mode.
Check for articles related to running Selenium as local admin

Run c# code on client side or make a web session interactive?

I'm making an application on c# for signing PDFs. Its works perfectly on my visual studio web project, but when I publish it on my test server it throws me this Error
In this case I'm trying to execute the code that sign a pdf on the server and the error occurs specifically on the line:
System.Security.Cryptography.Pkcs.SignedCms.ComputeSignature()
It is supposed to throws a window on your desktop asking for your certificate (reading a smart Card) and then asking for your PIN just like this
Windows Security Window but I have the hunch that it's not possible because Its implies that the server have to have the possibility to interact with the client's desktop
Ok, now that I've explained all the enviroment that I'm facing, here are the solutions I've tried until now:
1) Trying to correct the Server Error above: I went in the server to IIS>application Pool>MyPage>Advanced Settings>Process Model>Load User Profile and selected True instead of False (Didn't Work)
2) Still trying to correct the Server Error I Went to Computer Management>Services and Application>Services and turned on the service "Interactive Service Detection" (Still not working and doesn't work even if I do the same on the client computer)
3)Finally, I guess that it's not possible to run the code on the server because the Error line above is a native calling of Windows Security so I thought: what if I try to run the code right from the client?. Like a c# applet equivalent or something, well... there are two ways for do that: ActiveX (old technology) and Silverlight (newer). The thing is that I just can't make a simple Silverlight program start on chrome, it does on firefox and IE but if doesn't work on chrome is a totally waste so my last option is to make it run with an ActiveX, and there is almost none useful information in the internet about that
If someone can tell me what to do, either to correct the error or to make my program run from the client side, I would be so grateful
You can't call the system's api from a Web client as this would break the sandbox. If you must use that system call, create a wrapper on the server that will handle the popup, although this would be a very "hacky" solution. You should really be asking why I am trying to use a Web client interface if I must use said native system call.

troubleshooting a website that doesn't give errors

I have an asp.net web forms, web application that I am working on where the user fills out a form that is currently a paper form and we are trying to get it on an ipad. The form is filled out and then using a .net windows form webbrowser control and bitmap library, I take a screen shot of the form and save it to a server on the local network. The applications works 100% of the time when I run it in debug mode out of visual studio 2013, regardless of web browser. As soon as I publish to IIS 7.5 running on the same machine I am developing on to test it out, it stops working. Everything returns 200 codes like it should but the image of the form does not get saved and I get no errors. I added a console property to the class I'm using to create the image of the form that adds statements after each line of code that I then write to the web browser console and all lines of code are being executed. I don't know what to do next to try and figure out why this isn't working. Any suggestions?
My gut tells me this may be a permissions problem. Have you ensured the security context under which your IIS app domain is running as write permissions to the folder in which you are storing the files? In 'debug' mode, your user account may already have permissions, but not so with the IIS security context. You may be getting access denied errors that you are somehow swallowing in your code. Just a hunch. Post more details for better diagnosis.

Attaching ants performance profiler to asp.net-mvc site fails

Currently my asp.net-mvc site makes the w3wp.exe process cpu run at 100%.
I figured red-gate's ants profiler should be able to give me some clues as about where I should be looking.
When I start a profiling session I can choose between IIS hosted- and dev server hosted asp.net web application. One of these look like the most logical option to choose from to me
ASP.NET web application (hosted in web dev server)
I pointed it to my web app's dir (where the default.aspx) is at and set the bind port to the correct port.
Pressed the Start Profiling button
ASP.NET web application (hosted in IIS)
After loading and launching the project, I filled in the complete URL to my localhost (including port) and pressed "Start profiling"
Both options fail with the following exception
Retrieving the COM class factory for component with CLSID {0002DF01-0000-0000-C000-000000000046} failed due to the following error: 80070002.
System.IO.FileNotFoundException
at bP.a(Boolean )
at bP.a(Uri )
at bT.LaunchFrontEndProcess()
at RedGate.Profiler.Session.ProfilerSession.i()
at RedGate.Profiler.Session.ProfilerSession.j()
Any ideas?
That looks like it's ANTS trying to open Internet Explorer, but for some reason it can't. You haven't used windows 7's ability to uninstall internet explorer by any chance have you?
Keep an eye on http://www.red-gate.com/products/ants_performance_profiler/index.htm as we're hoping to switch to using your default browser for this rather than always using IE at some point soon.

Categories

Resources