Getting Exception handling error while debugging the Windows Phone Test Framework by expensify - unit-testing

I have set up the environment for Windows Phone test Framework in Visual Studio 2010 Professional.
While debugging Unit Test using Resharper, i am getting exception handling error.
"A first chance exception of type
'WindowsPhoneTestFramework.Server.Core.AutomationException' occurred
in TechTalk.SpecFlow.DLL"
How can i fix it and run my scripts for WP7 emulator?

WPTF works by setting up a SOAP server on the desktop host which the application then connects to, it looks like the phone can't contact the host. This could be because it hasn't been setup or because it didn't have permission to start.
From the WPTF readme:
•
For some script runners, then you may need to change script runner to have the 32-big flag set - try to find a 32-bit alternative (e.g. nunit-console-x86.exe) - or (at worst) use CorFlags.exe to change your test-runner.
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\CorFlags.exe" "your target.exe" /32BIT+
•
The server part of the code opens a WCF service on http://localhost:8085 - it needs permission to do this - use:
netsh http add urlacl url=http://+:8085/ user=\
Have you tried these? It might be worth getting a developer involved if you aren't comfortable with the instructions.

Related

Windows Defender Blocking Installer (MSI) for a 32-bit, MFC app on Customer PCs

I'm supporting a 32-bit, MFC-based application. For deployment to customers an MSI installer file is created via Visual Studio 2015. I have some customers reporting that the cannot install the application due to Microsoft Defender reporting a severe warning:
Exploit:O97M/CVE-2017-11882.JR!MTB
On my side, Norton Internet Security shows all the files to be clean. MalwareBytes also shows all files to be clean. How do I prevent this warning from showing up on my customer side?
Digital Signing: The setup can obviously be infected on the end user's PC even if your original setup is not - or your own setup could contain real malware or a false positive. Digital signing can help a bit - as stated by others. A digital signature verifies that the setup has arrived unchanged from the vendor. Certificates are not 100% reliable, and they are also expensive if you get an EV certificate ("Extended Validation Certificate").
Signtool.exe: See this old answer: Odd 'Program name' when installing signed msi installer. For ad-hoc signing I suppose you can try the signwizard as shown here. For build automation you would want the full command line. I haven't tested that in a while, maybe try this answer.
Warning: Be careful not to sign malware! Obviously. Then you have: signed malware. In that sense it is proven - certified even - to come from you. Irony.
VirusTotal.com: You should run scan on all binaries by zipping them and uploading to virustotal.com as your first step. This is screening for both malware and false positives. Sometimes I try the Kaspersky checker too. ESET has a free scan feature for your computer (not uploaded files): https://www.eset.com/int/home/online-scanner/ and also a "SysInspector" tool which can help diagnose potential infections on any computer.
SmartScreen: Windows Defender includes SmartScreen - a trust-based feature which flags setups that are unknown, unsigned and deemed unsafe. Here is some information: Windows Installer, Digital Certificates and SmartScreen
See these existing answers:
How can i generate windows certificate so my msi doesn't shows warning to users
Microsoft Defender Smart Screen Preventing my MSI to run
Process Explorer: A nifty feature of Process Explorer from Sysinternals / Microsoft is the ability to scan every process on your computer and using VirusTotal.com from inside the tool. See this video. Here is a screenshot of the tool in action - it has found malware running on the PC:
Links:
InstallShield: Digital Signing and Security
Using SignTool to Sign a File
Thanks for all of the ideas.
The problem seemed to go away with signing via adding this command to the "PostBuildEvent"
"C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe" sign /a $(BuiltOuputPath)

How to fix "Please ensure that target device has developer mode enabled" error in Hololens Emulator

The problem that I have is that after I have built my Unity project using Microsoft's Mixed Reality Toolkit and the Windows SDK 10.0.18362.0 I try to deploy it using the Hololens 2 emulator (version: 10.0.18362.1019). The result is that even though the emulator opens, my Unity application does not get deployed and the following error is being shown in Visual Studio's error list:
Please ensure that target device has developer mode enabled. Could not
obtain a developer license on 192.168.9.57 due to error 80004005
I found several articles online that had the same problem like me, and they either referred to resetting the HoloLens device (which I do not need to do, since it is an emulator) or enabling the Developer Mode on the host machine (in my case a fully updated Windows 10 Enterprise Edition computer), which I already have. Nevertheless the error persists.
I just hope that there will be a way to get rid of this error and manage to deploy my Unity application onto the HoloLens emulator.
It seems that the solution is very simple. If you actually run Visual Studio as an Administrator the application is successfully deployed onto the emulator.

Unable to connect to the Remote Debugging - Web App Azure

I am trying to remote debug an Asp.Net Core Web Application (with Web API) project deployed as an Azure App Service with Visual Studio 2017 Professional.
Followed the instructions as documented here. Essentially, using the Server Explorer-->App Service-->Attach Debugger
Also, enabled the necessary firewall ports as mentioned. The ones I opened are TCP (4022, 4023) and UDP (3702). Also, ensure remote debugger application is in allowed list of apps in Windows Firewall. Documentation for the firewall steps.
Despite all the settings, I am getting following error
System.Runtime.InteropServices.COMException (0x89710023): Unable to connect to the Microsoft Visual Studio Remote Debugger named 'essamplepoc2.azurewebsites.net'. The Visual Studio 2017 Remote Debugger (MSVSMON.EXE) does not appear to be running on the remote computer. This may be because a firewall is preventing communication to the remote computer. Please see Help for assistance on configuring remote debugging.
at Microsoft.VisualStudio.Debugger.Interop.Internal.IDebuggerInternal120.ConnectToServer(String szServerName, VsDebugRemoteConnectOptions[] pConnectOptions, CONNECT_REASON ConnectReason, Int32 fIncrementUsageCount, IDebugCoreServer3& ppServer)
at Microsoft.VisualStudio.Web.Azure.MicrosoftWeb.Operations.RemoteDiagnosticsSessionBase.ConnectToServer(String site, String user, String password)
Any suggestion would be helpful.
The issue is resolved. We had to open outbound ports 4024 for VS 2019, 4022 for VS 2017 and 4020 for VS 2015 on corporate firewall.
For more info check these out:
https://learn.microsoft.com/en-us/visualstudio/debugger/remote-debugger-port-assignments?view=vs-2019
https://learn.microsoft.com/en-us/visualstudio/debugger/configure-the-windows-firewall-for-remote-debugging?view=vs-2019
I also had this problem. I solved it by changing the Platform from 32-bit to 64-bit in Application Settings as I am trying to debug from 64-bit machine.
It seems remote debugging is not turned on for your App Service.
Open your App Service in the Azure portal and go to Application Settings. Then turn Remote Debugging to On and select Visual Studio Version to 2017.
It should look like this:
Screenshot source
I hope this helps.
First, what did NOT work. Opening the port in my Firewall did not work for me. Restarting my local machine did not work, neither did restarting the app in Azure, nor updating VS2019 with the installer. I kept getting:
System.Runtime.InteropServices.COMException (0x89710023): Unable to connect to the Microsoft Visual Studio Remote Debugger named 'empirepipedriveapi-newversion.azurewebsites.net'. The connection with the remote endpoint was terminated.
Finally, what DID work, I deleted the deployment slot and then added it again, I deleted the publish profile in Visual Studio 2019 and recreated it again, a published the app (without even recompiling it) and then WAS able to connect (I did refresh the available slots in the Cloud Explorer first just to be overly careful). I believe, and this is the 2nd time in about a year, that, on rare occasion, the deployment slot can become corrupted. I noticed this time when I published the app, it took longer and it seemed much more activity took place, leading me to believe that there was code in the old slot that was is not refreshed on each and every publish and it must have become corrupted.

Remote Debugging from VS2013 getting Unable to Connect to Remote Debugging Monitor

I'm trying to remote debug from Visual Studio 2013 to a remote server running Windows Server 2012.
I have run Msvsmon from my remote server and the Server Name in Options is FEP\build#DSS1Build1. I have set Windows Authentication and also given EVERYONE permission to Debug.
On Visual Studio on my own machine I do Attach to process and in the Qualifier field put the same Server name ie. FEP\build#DSS1Build1.
However when I press Refresh I get the message:
"Unable to connect to Microsoft Visual Studio Remote Debugging monitor... does not appear to be running on remote computer"
Is there something I need to unblock in the Firewall?
A couple of things need to be done.
On the remote server, you need to start Visual Studio Remote Debugging monitor and make sure you run it as a admin user (as otherwise you can't connect).
Make sure it is the right version (depends on if your server is 64bit or 32 bit).
Also you need to make sure that the remote debugging service is running. You can run the configuration wizard to see the status.
Then you need to put the full qualifier in as you mentioned.

Command line application running as a windows service. Getting error 1053

I have created a c++ command line application. This application sends a revives messages from other computers and logs the results to a file. A simple application. One of the first things the app does is write to the log file the start up time.
Now that I have gotten the application to a good place, I want to install it as a service that runs on my computer (win 7).
I am using the NSIS, Simple_Service_Plugin to install the application and register the service in windows. I can see the service in windows service manager.
When I attempt to start the service, I get the following error message. The log file does not get created.
Windows could not start __THE_APP__ service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.
When I start the app from explore it starts without any problems and the log file is updated correctly.
When I search this error message on-line I find lots of help for C# and .Net applications and nothing for c++ apps.
My question is:
How do I start a C++ application (not dot.net) as a service?
A service isn't a regular appliction. It's a program that uses specific system classes and implements certain features that enable the OS to communicate with it.
See here (and the surrounding pages) for more details.