How do I get the Emulator on the same network as my PC? - networking

I've created some Web API methods in .NET 4 / Visual Studio 2010 (and have now ported it to VS 2013 RC).
I want to consume them from a Windows CE / Compact Framework app using RestSharp.
Regardless of how I call these methods, though, I need to know the IP Address to use for the app running the Web API methods. I can access it from a browser using "localhost" and the port number Visual Studio displays when running the View for the Web API project in the browser (works fine, returns XML in Chrome).
But: how can I call it from my Windows CE / Compact Framework app? The emulator in which I run it doesn't believe that it and localhost are really on the same machine, so I can't use that, nor the machine's actual IP address as, again, it is delusional about who/where it is.
So: what is the workaround? How can I test this?
More details about this can be seen here: RFC on HttpWebRequest vs RESTSharp from Windows CE / Compact Framework 3.5
UPDATE
Vasily, my guess was that you meant for me to do this:
...but that led to this:
Note: I get the same when I choose the other option from the dropdown asociated with the "Enable NE2000 PCMCIA network adapter and bind to:" czechbox, namely "Intel(R) 82579LM Gigabit Network Connection".
And trying to install http://go.microsoft.com/fwlink/?linkid=46859 (both the 64-bit and the 32-bit flavors) slapped me with:
So tell me, I implore: Is there balm in Gilead, so that there may be joy in Mudville tonight?
UPDATE 2
In step 6 (bullet 6), I did this:
...which got me first a message that the software didn't install correctly, with the option to retry or assert that, no, everything is really fine (I chose the latter), but then this:
...IOW, I don't make it to step/bullet point 7
Then again, this Peek cat did warn, "Note that this is very much a “works on my machine” experience. If it burns your house down, don’t hold me responsible."
My house didn't burn down (I don't think - I'm not there right now), but the process to extract the file did fail ignominiously.

You can use workstation network card by the emulator. Todo it you have to select "Use installed network card" checkbox and select the card from the list. after that you can use the workstation ip.

This was helpful for me:
Windows Virtual PC and the Microsoft Device Emulator
I've had to use it more than a couple of times.
I saved the file as a PDF to my network folder, so it took me a while to find the link.

Related

obtain data from remote computers using autoit

I have been maintaining a program written in batch. I want to write a replacement program using autoit.
The program is downloaded to the desktop of remote computers and prints out a log of the scan results in notepad on the desktop.
I want it to cover windows XP-vista-7-8-8.1-10. At the moment it does not cover 8-8.1 or 10.
This is the printout:
Results of my test version 001
Windows 7 x86 Service Pack 1 ---- (shows in brackets if service pack is out of date)
(UAC) --- shows if UAC is on or disabled.
Internet Explorer----(shows if out of date)
Antivirus/Firewall Check:
Windows Firewall Enabled!
Panda Free Antivirus
WMI entry may not exist for antivirus; attempting automatic update.
Anti-malware/Other Utilities Check:
CCleaner
Java 8 Update 31 (Java version out of Date!)
Adobe Flash Player 17.0.0.188
Adobe Reader XI
Mozilla Firefox (38.0.5)
Thunderbird (38)
System Health check
Total Fragmentation on Drive C: 2%
````````````````````End of Log``````````````````````
So this is possible. To get versions of files(like java and firefox) I think you can use FileGetVersion
To get if windows filewall is enabled you have to read the registry. This key might be a little bit different depending on your system but the one for me was this one
RegRead("HKLM\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\", "EnableFirewall")
These two macros should be usefull to determine OS specific information that you request
#OSType
#OSVersion
UAC can also be read from the registry and as with the firewall it might depend on your system but for me this was the registry:
RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA")
Im not quite sure what the Total Fragmentation means so I am not sure how you can get this.
You should be able to compose a txt file with all this information. You should be able to find examples of autoit code that transfers text files just by searching here on stackoverflow or on google.

How ODBC connect to SQL Anywhere 12

I'm using sqlAnywhere 5.0 to create ODBC with third parties software house
I'm running it on windows XP without any error / problem
but 8/4/2014 Microsoft announce to stop service for windows XP
then our company migrate all client PC to windows 7x64
Now the application always hang and closed itself
I would like you suggest what can I do, I'm trying to test under SQL Anywhere 12.0 but I cannot config ODBC to open application
I also attached a picture (ODBC from rtdsh50.exe)
Start command is "C:\Starlims8\SqlAny50\Win32\rtdsk50.exe -d -c4000"
Please advise, Thank you in advance.
According to the image, you are using the version 5 runtime engine. This software is almost 20 years old... I am not surprised you are having trouble getting it to run on Windows 7.
It doesn't look like you are providing a database file on the startline in the ODBC configuration. Are you providing this somewhere else? What does your actual connect string look like in the application?
Version 12 will probably not work, since your application was written for version 5. However, to even have a chance, you have to rebuild the version 5 database in version 12 format and then replace the SQLA version 5 ODBC data source with a version 12 one with the same name.
Is this an application that you/your company wrote or is it a third party app. you purchased? Is it a 16 or 32 bit application?
Also, I would suggest setting the application up to run in compatibility mode as well as running it as an administrator.

Chromedriver is extremely slow on a specific machine using Selenium Grid and .net

Overview:
Chromedriver works normally on one machine but extremely slowly on two other identical machines.
Setup:
Selenium Webdriver using .Net for coding and Selenium Grid for distributing the tests. MSTest is being used from within Visual Studio 2010 in order to run the tests.
A 64bit Windows 7 local machine acting as the Hub
Three 32-bit Win 7 remote machines (two of them are virtual) on my local network all configured as nodes. Here is the command used to start the nodes on the remote machines:
java -jar c:\seleniumWebDriver\seleniumGrid\selenium-server-standalone-2.31.0.jar -role node -hub http://XXX.XXX.XXX.XXX:4444/grid/register -browser "browserName=chrome",maxInstances=4 -Dwebdriver.chrome.driver="C:\seleniumWebDriver\chromedriver.exe"
The driver is launched like this from within the code:
DesiredCapabilities capability = new DesiredCapabilities();
capability.SetCapability(CapabilityType.BrowserName, browser);
driver = new RemoteWebDriver(new Uri(hubUrl), capability);
The variable "browser" and "hubUrl" above is passed via an app.config file that is built at runtime. For this case, browser=chrome.
Problem:
When I setup machine 212 (which is a virtual machine) as a chrome node using the command above, and then launch the scripts from the hub, I see chrome start in the proper remote machine and run normally. It fields between 5-10 commands per second.
When I setup either machine 78 (virtual machine) or machine 103 (real machine) as a node in the same manner, and then launch the scripts from the hub, I see the node start up chrome properly. However, it runs extremely slowly, like 1 command per sec or less.
Other info:
Like I said, on one machine chrome works normally, but on the others, runs extremely slowly. Firefox and IE, when configured as nodes, work normally.
I have compared the machine 212 (which works properly) with the other machines and cannot find the difference. All the machines are using 'selenium-server-standalone-2.31.0.jar' and the same version of the ChromeDriver.
It does not appear that the node machines are being overloaded. Also, it is a very consistent difference in performance which does not seem related to any fluctuating load on the network or the machines.
My network tech has verified that all these machines are configured identically on the network.
Has anybody seen anything like this before?
EDIT 1: I logged in today and all three remote machines are running chrome slowly. Before one of them was normal, but now they are all slow.
I ran into a similar issue where chromedriver was slow in some machines and it turned out to be a proxy issue. Disabling "Automatically detect settings" under Chrome://settings >Change proxy settings> LAN Settings> made webdriver execute commands faster in chrome for me.
My proxy settings were not using automatic detection, but I found the following helped a lot. The time it took to start the driver went down from 43 seconds to 1 second
driver = new ChromeDriver(new ChromeOptions{Proxy = null});
Bug link in chromedriver issues This is long lasting issue that got lowest priority. But as more user will vote for it maybe someone will fix it. It could also be releated to Parsing of proxy configuration is not standard compliant which will be fixed soon.
This code solved the problem for me for Chrome 75 on macOS 10.14.3
ChromeOptions options = new ChromeOptions();
options.setProxy(null);
driver = new ChromeDriver(options);

Setting up IIS7.5 for local ASP.Net Development

Are there any particular settings one should optimally enable/disable/tweak when doing ASP.Net MVC development on local test machine Windows 7 using IIS 7.5 and moving in and out the debugger & recompiling refrequnetly (integration/troubleshooting stage now before TDD fantactics throw stones - although admittedly I could have more under test), I work with 64 bit edition but figure this probably applicable at both x86/x64?
I'll start with one:
Ping Period (seconds) - increase from 90 to 3000 (or something somewhat higher) so you can if unfortunately need to a good bit of time whilst debugging or disable ping on local test machine.
Credit: http://blogs.msdn.com/johan/archive/2007/09/12/my-web-application-times-out-when-debugging-in-iis7.aspx
However I see over stuff such as:
Disable Overlapped Recycle & Recycling settings etc.. that I wonder if could increase performance or make debugging less friction
Question prompted by the annoyance that I've ran across a few recent debugging issues (not apparent in production) including a random, and tempormental error "An assembly with the same simple name blah-blah-lah-assembly-definiton has already been imported . Try removing one of the references or sign them to enable side-by-side." (iisreset resovles) and generally slow debugging attaching. The points and answers to this question need not help with the above (I believe it may be related to spark view engine as that where the stacktrace ends) but figure it worth mentioning incase someone has a direct suggestion *
quick tip: if you're experiencing slow response times (~1-1.5 sec) from browsers other than internet explorer (eg: firefox, chrome, safari) while running your mvc/ other web app on your local machine using win7/vista, it is due to dns resolution with ipv6.
firefox solution: disable ipv6 in about:config (boolean cfg 'network.dns.disableIPv6')
machine wide soft solution: uncomment the good old localhost address in the hosts file (%WINDIR%\System32\drivers\etc\hosts):
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
# ::1 localhost
machine wide hard solution: disable ipv6 completely
credit goes to this blogpost: http://weblogs.asp.net/dwahlin/archive/2007/06/17/fixing-firefox-slowness-with-localhost-on-vista.aspx
Embarcadero guys just published a fresh article on similar topic for Delphi Prism (aka Delphi for .NET), so why not take a look on their suggestions?
http://edn.embarcadero.com/article/40108
From the experience i have working with asp.net mvc, i can tell that there are no special settings for IIS 7 or IIS 7.5 for working on asp.net mvc projects. It works fine in the default form, you just need to create a new website and point it to the folder that has the files for you application.
For debugger if you ask, you can simply put a breakpoint in the code and hit that breakpoint when you run the application from visual studio. But by default the application will use the development web server that fires up when you run a web application from visual studio. If you want to the application to run using the IIS installed on your system you will have to change the project settings. See here for a screen shot of how to do so
http://blogs.bootcampedu.com/blog/post/Debugging-aspnet-mvc-application-using-IIS.aspx
Additionally you can also use System.Diagnostics.Debugger.Break(); for putting a break point in the code.
If you only want to debug your application, I recommend to use the built-in development server of Visual Studio.
If you debugged the most of it or want to do that on IIS, I recommend you the Ctrl+Alt+P shortcut, which enables you to attach a debugger. Select w3wp.exe and you can debug with IIS.

Sysinternals' Portmon: Error 2

When I try to connect to local ports, Computer -> Connect local, using Portmon v. 3.02, I'm getting an error message, Error 2, in a small error dialog box:
I run the tool as an administrator (if not, I get error 6).
By the way this is a Windows 7 x64. On 32-bit, in Windows 7 x86, it works fine. How can I fix this problem?
Sysinternals' Portmon works only on 32-bit versions of Windows. It does not support 64-bit (probably its driver is not signed).
From the Portmon homepage:
Runs on:
Client: Windows XP (32-bit) and higher (32-bit).
Server: Windows Server 2003 (32-bit) and higher (32-bit).
In Windows Explorer, right click on portmon.exe --> select Properties --> click the Compatibility tab, and Run in Windows XP compatibility mode. It works fine like that in Windows 7 64-bit.
"Error 2" is "Cannot find the file specified", that is, cannot find a required DLL file.
Originally, you got this error when you tried to run Portmon from a network location: that broke the security trust, causing Portmon to be untrusted (or perhaps just messing up the search path somehow).
On my copy of Windows 7 64 bit, Microsoft Dependency Walker (depends.exe) tells me that PORTMSYS.SYS (the file created/loaded by Portmon.exe), has unresolved dependencies on ci.dll, clfs.sys, hal.dll and kdcom.dll.
Those are the
code integrity
common log file system
hardware abstraction layer
kernel debugger com
libraries, and they aren't actually missing: if they were, Windows wouldn't boot. However, I don't see a copy of those files in SysWow64. This suggests to me that the problem is not with portman.sys: the problem is with the win32 compatibility layer in Windows 7/64 bit: It doesn't support debug properly.
It is now 2018. There is no 64-bit version of Portmon. Serial ports are a legacy standard. The Windows 7 problem was fixed by the release of Windows 8.1. However, there is a faint chance that some Visual Studio utility or security update back-ported to Windows 7 will fix the problem. Perhaps someone who is familiar with SysWow and debugging will comment.
Instead of portmon for Windows x64, you can use an emulator of a pair of virtual COM ports and a simple program that will connect the physical port and one of the virtual ones, as well as perform the logging function.
To create a pair of virtual COM ports you can use:
com0com (preferably version "com0com-2.2.2.0-x64-fre-signed", because it contains signed x64 driver)
Virtual Serial Ports Emulator (VSPE), every time it starts on x64 it asks to purchase a driver, but it works even if you refuse.
Simple mapping and logging program can be found e.g. here or you can write it yourself, it is simple.
The sequence of actions is follows:
Сreate a pair of virtual COM ports using emulator (for example, COM28 and COM29)
Let the external device be connected to the computer COM1 port. In the program, whose exchange with external device we want to listen to, we set up a port COM28 (instead of СОМ1) for communication.
In the mapping program, we set up that we want to bind and log ports COM1 and COM29 (don't forget to set the port baud rate).
I haven't tried it yet, but this question mentions com0com. It creates two virtual serial ports and emulates a null modem cable between them. It claims to be able to run on 64 bit Windows. I'm not sure whether it comes with software that lets you just pipe input from a real port into one of the virtual ports. One of the FAQ's says that you can turn on logging.
I guess in the worst case, you could write your own small program that pipes data from a real port to one of the virtual ports and logs it all.
There's also this question on open-source alternatives that mentions a couple of projects.
I've used AccessPort
http://sudt.com/en/ap/download.htm and it works great. Very similar to Portmon
Don't start Portmon from a network drive/path or something else.
Copy on to the hard disk drive, e.g. on the desktop, restart and try again!
If you run Portmon in compatibility mode, it will work.
Check Make older programs run in this version of Windows.
It says:
To run the Program Compatibility troubleshooter:
Open the Program Compatibility troubleshooter by clicking the Start button Picture of the Start button, and then clicking Control Panel. In the search box, type troubleshooter, and then click Troubleshooting. Under Programs, click Run programs made for previous versions of Windows.
Follow the instructions in the troubleshooter.
The above is a public explanation from Microsoft for a common situation when running older applications in Windows.
But, I can say it briefly;
Right click on portmon.exe
Select menu about "troubleshooting compatibility problem" or something like that (I'm using a foreign version of Windows, so I don't see correct name of that menu in English.)
Select automatic mode
It will detect the problem and recommend Windows XP (SP2) mode
Select it and execute Portmon again.
I hope it works!
Instead of Portmon you can also use the IO Ninja program with the "Serial Monitor" plugin.
It gives a little less information than Portmon, but in a more understandable form. The main thing is, just like a Portmon, it allows you to see the data that is transmitted between a third-party application and an external device via a serial port. The program works under modern versions of Windows (I tried it myself on Windows 10 x64). The aforementioned plugin "Serial Monitor" is paid (but has an evaluation period).
Note: the port that you want to monitor must first be connected to the "IO Ninja" program, and then opened in a third-party application whose exchange with an external device you want to track.
Just to test that the hardware is working, you could perhaps boot a Linux live CD and run the statserial and/or minicom program to verify that it works. The Knoppix distribution seems to contain both those programs.
Serial ports on Linux are named /dev/ttyS0 for COM1, /dev/ttyS1 for COM2, etc.

Resources