Xamarin WebSocket throws exception: ConnectFailure when for 'Release' - c#

When I change my Xamarin Android App from Debug to Release, the websocket starts throwing a WebsocketException: ConnectFailure (Access denied). However if I use it in 'debug' it works perfectly and handels the whole communication process within a few seconds.
Any idea why this might be happening? There are no #IF DEBUG statements in my code, also the app already worked fine a few weeks ago on Release.

Welp, sometimes problems get more obvious once you type them out. I had to add 'INTERNET' as a required permission to my app. No idea why it worked before, but that did the trick.

Related

HTTP Error 500.30 - ANCM In-Process Start Failure - 'Microsoft.Data.SqlClient.TdsParser' threw an exception

After upgrading to .net core 3.1(3.1.12 sdk) everything works fine on localhost(hosting model outofprocess and inprocess) but when publishing to azure i have issues with the inprocess hosting model, it does not run at all and i get the error below.
After some further investigation and updating every package(including entity framework) to 3.1.12 compatibility, switching every project from Any CPU to x64, solving any compatibility issues with all packages, the code still breaks, but i found out where, and i still can't determine why this happens.
Also the error comes from this part of code(ADDED TRY CATCH TO SEE IF THE APP WORKS WITHOUT IT, AND IT DOES BUT WE NEED THIS PART, AND I'M PRETTY SURE OTHER STUFF WILL BREAK FURTHERMORE):

MdilXapCompile.exe -- Windows Phone Device Deployment Error

I'm trying to deploy my appo to my Lumia 930 so I can test it on something other than an emulator, but every time I hit F5 it basses the build but crashes on deplyment.
MIDLXapCompile log file:
CrossGen failed
Error processing assembly C:\Users\mrrey_000\Dropbox\Dev\Windows Store\AnimeWatcherXYZ EX Summer\AnimeWatcherXYZ.WindowsPhone\obj\ARM\Debug\MSIL\Microsoft.Advertising.Mobile.Display.winmd
Raw error code: 2148733978
I tried deleting the reference to the Microsoft Advertising SDK and applying i oce again, I've also tried to remove the previous version of the app from my device - didn't help.
And yeah, I'm deploying a DEBUG package, not RELEASE.
How can I fix this?

Error while trying to run project. The address is not valid for this context

I have 64x console application in VS 2013. When I've tried to run x64 application in debug mode, I've got a message:
Error while trying to run project: Unable to start program [PathToMyApplication].
The address is not valid for this context.
For 32x application it worsk fine. Reinstall VS 2013 did't help. What can I do?
My error message is similar when starting the project:
"Error while trying to run project: Unable to start program 'C:\Project\StrictAny\PrensentationLayer\bin\PPEREM.exe'
The address is not valid for this context "
I solved the problem by switching [Solution Explorer=>Solution Properties=>Active config=>Debug|AnyCUP] to "Debug|x86"
Then the application proceeds in starting.
hope this helps anyone.
The problem was in sniffer software "SearchInformAgent".

Selenium WebDriver with ChromeDriver - C# Visual Studio 2012. Debugging impossible

Few lines program perfectly works if running with ctrl+F5 (not debugging) but throws exception when running with F5 (debugging):
private static void Main(string[] args)
{
IWebDriver driver = new ChromeDriver(#"C:\Program Files (x86)\ChromeDriver");
This statement throws "No connection could be made because the target machine actively refused it" exception with no inner exception.
Again, it works perfectly with ctrl-f5
Windows 7 x64
VS 2012
Using Selenium WebDriver NuGet Packcge 2.35 (latest)
Using ChromeDriver.exe (v2.4.226107) (latest)
All firewalls and antivrus etc was killed.
Running VS as admin and UAC turned off
Why is this difference between debugging and running without debugging?
(I know that debugger has a host process please do not explain that)
How can I run this simple program in debug mode?
Any ideas?
Thx in advance
Thanks for all who spent time with reading and thinking about this question.
I've solved it. Well, it's a stupid thing but I am pretty sure that similar questions here complaining Selenium WebDriver and
"No connection could be made because the target machine actively refused it" exception
has this resolution, and other answers there missed the correlation between the issued solved and taken actions. Most of them suggest use other version of ChromeDriver.exe and talking about version incompatibility and ChromeDriver.exe bugs.
I think (at least my case) these resolutions are false.
The "error" comes from the WebDriver assembly and not about ChromeDriver.exe. I've examined the source of WebDriver, here it is:
while (!processStarted && DateTime.Now < timeout)
{
try
{
request.GetResponse();
processStarted = true;
}
catch (WebException)
{
}
When the DriverService class starts the ChromeDriver.exe immediately starts polling it with requests. Because it takes time the process to start, the port is not open for the first few dozen try... (at least a Sleep(10) or Sleep(50) would be nice here, but anyway)
Now the point: If you are so unlucky, you not checked the VS 2012 Options/Debug/General 'Enable Just My Code' and you checked the Debug/Exceptions/Thrown then debugger will break by this exception, but of course you will not see the source, the exception line will be your line
IWebDriver driver = new ChromeDriver(#"C:\Program Files (x86)\ChromeDriver");
Depending on timing (process start), you can get couple repeated time, and you will think your port, firewall, ChromeDriver.exe version, etc has to do with the exception.
I had this error at one point as well..and after hours of debugging..finally got the real error to show...my view for the I.E. browser was set at 125%...and when I changed it back to 100%...it worked. :)

Is MonoDevelop remote debugging works on Windows

I'm using mono-2.6.7 and monodevelop-2.4, my OS is Windows 7.
I'm trying to implement a remote debugger for my own runtime (based on mono, mono is embedded in it, used lang - C#) in a way it's done by Novell for Moonlight.
Unfortunately, no success...
After clicking "Debug" in MonoDevelop:
IDE is put into debug state,
my runtime starts,
successfully sends DWP-Handshake to listening IDE
and then connection terminates and Debugging ends.
For some reasons (absolutely not clear for me) IDE doesn't send a handshake after recieving it from my runtime but simply terminates a connection.
The code i use is in another question: Can't use Mono Soft Debugger Remote Debugging because 'debugger-agent: DWP handshake failed' error
Does smb know if it can be done the save way it's done for Moonlight? Or it's it's impossible? Maybe there is another solution?
Prooved! It works. The problem was in unhandled exception thrown by VirtualMachineManager.ListenInternal(2) method in Mono.Debugger.Soft. More details here - Can't use Mono Soft Debugger Remote Debugging because 'debugger-agent: DWP handshake failed' error

Categories

Resources