I am developping a Xamarin.Forms app that should be compatible with Windows(UWP), Android and TizenTV. I am using .Net Core SignalR Client. The App works fine on Windows & Android but I can't get it to Work on Tizen (main Code is the same). Especially one line of code from signalR is not Working.
hubConnection = new HubConnectionBuilder().WithUrl(apiUrl+ "registration-hub").Build();
If it is excecuted in an Emulator with the Visual Studio Debugger the code just leaves the thread and doesn't continue after this line.
It doesn't log errors or anything else. If try to change the Exception Settings in Visual Studio i get this notification:
This debug engine does not support exception conditions. The condition(s) will be ignored.
I tried updating & downgrading packages but nothing worked. I can reproduce this in new empty .Net Tizen Projects.
I've just had exactly the same problem on my Xamarin forms project. For me, the fix was:
Start debugging
"Exception Settings" window
Click 5th icon: "Restore the list fo the default settings"
Related
I have a very basic question about why all .NET Core applications are console applications. I did some google search but don't find any appropriate answer.
It's an interesting question, and I got here because I had the same thought: Why do I seem to always see a console on asp.net core apps? Are they all now console apps?
But it's a mirage. While you are seeing a console window, it's only because the code is using the console for output. The code that starts the app governs where the output is going to. For example, instead, the output could be ported to the Windows Event Log, which is what happens when the site is published to IIS.
If you create a default .netcore web app, and you look in the output directory, you will see two files:
YourProject.exe
YourProject.dll
If you double click the exe, it will start the website. You will see the console window appear and the app will start listening on port 5000.
But now rename YourProject.dll and try to run the exe. It will fail because the exe is just the startup code. Your website is actually in the .dll.
The point is that the console window you see when you start an web app is coming from the exe, not the dll. So the console window has nothing to do with your web app, it's just a convenient way to start up the app in a dev environment. You can also start it from the command line with dotnet YourProject.dll and it will run exactly the same as if you started it from YourProject.exe
If you read #HansPassant's comment, he says it exactly correctly, my answer is just an expansion of it.
.NET Core provides more than console applications out of the box, it has supported both WPF and WinForms since version 3.x. In the below documentation links from Microsoft you can see .NET 5.0 (which is .NET Core) is listed. If you're using Visual Studio you can chose between ".NET" (which is .NET Core and what it will be referred to going forward) and ".NET Framework" (which won't have any versions past 4.8). It should be noted, WPF and WinForms although on .NET Core are only supported on Windows.
https://learn.microsoft.com/en-us/dotnet/desktop/wpf/?view=netdesktop-5.0
https://learn.microsoft.com/en-us/dotnet/desktop/winforms/?view=netdesktop-5.0
I am getting an error in Xamarin when building a release version. I actually have never released code before, and i have no idea what im doing. if you could tell me, i am getting this error but i do not know how to follow the instructions because my Visual Studio doesnt have a menu called properties
Debug is not enabled in the current configuration. Please Start
Without Debugging or change it in Properties -> iOS Build.
Right click to IOS project--> open Proprieties page and enabled debug for IOS
I created a new .Net 2.0 web api project. And then click the "> IIS Express" button to test it. However, I got a popup of Windows Explorer.
Windows Explorer has stopped working
A problem caused the program to stop working correctly. Please close the program.
Close the program
Debug the program
Another window pops up after close the window.
Unable to start program 'http://locahost:24175/api/values'.
Invalid prointer
However, "Start without debugging" works.
Seems like you deleted the default ValueController without changing your default route. Check this answer on how to change it:
https://stackoverflow.com/a/44731550/837623
I am using visual studio 2017, created a new xamarin forms project and tried to run the UWP project. It shows the following error:
the project needs to be deployed before it can be started. verify the project is selected to be deployed the solution configuration manager, or deploy it explicitly by clinking one of the deploy commands in the build menu.
I have looked at all online solutions and only found that you need to set the cpu to x86 and to check the deploy checkbox under the configuration manager under the solution. Both these options don't work. I still get the same error. I have also tried every cpu option including ARM.
Have you tried to uninstall the existing UWP app from the Windows Start menu > All apps? Then deploy again from VS. It did the trick for me.
Sometimes when I create an app packet for win store; Visual studio seem to get hung up building to the packet (project needs to be deployed before it can be started -error).
I solve it by creating a new app packet.
I am having issue debugging Android project. I can deploy to device and run it, all works fine but if I try to debug, the app gets deployed to the device and very briefly opened, splash screen shows up but the app then closes.
I am using Xamarin Forms on Visual Studio 2015.
Device is running Android Oreo (8.0.0). Another device running Android 6.0.1 is debugging fine.
The output shows following:
InspectorDebugSession(11): StateChange: Start -> EntryPointBreakpointRegistered
InspectorDebugSession(11): Constructed
Android application is debugging.
InspectorDebugSession(11): HandleTargetEvent: TargetExited
InspectorDebugSession(11): Disposed
Couldn't connect to logcat, GetProcessId returned: 0
I checked Logcat and it seem to be having issues finding FFImageLoading library:
Time Device Name Type PID Tag Message
09-18 14:35:52.361 Huawei Nexus 6P Debug 1560 Mono AOT:
image '/usr/local/lib/mono/aot-cache/arm/FFImageLoading.Platform.dll.so'
not found: dlopen failed: library "/data/app/myapp.android.dev-
WEb1bz8edgF7vwx6uCoZ-A==/lib/arm/libaot-FFImageLoading.Platform.dll.so" not found
I have added Nuget package for FFImageLoading to my projects and Droid project references show it as in image below:
This worked for me :-
Deselecting the 'Use Shared Runtime' in Project Properties > Android
Options > Packaging properties
I also had this issue with Android 8.1 and Visual Studio 2017 15.7.4.
There are three steps to got it working again.
Under Android Options, go to Advanced and add your device architecture, in my case it was x86_64.
Go to Tools -> Options -> Xamarin > Android Settings and enable: Provide debug symbols for shared runtime and base class libraries.
And the final step is to delete following Apps from your device:
All Xamarin.Android API Support libraries
Mono Shared Runtime
Your App
After these steps you don't need to disable "Use Shared Runtime" and can Deploy and Debug much faster.
This is a known issue with Oreo and Xamarin Android on Visual Studio for Windows. It works on Visual Studio for Mac apparently. It will be fixed in an upcoming release. In the mean time there is a work around down near the bottom of the bug link above (comment 20).
deselecting 'Use Shared Runtime' in Project Properties > Android Options
delete bin & obj files from solution
clean solution
rebuild the solution it works
One another reason for that is if you dont enable usb debugging on your device, VS 2017 still recognizes your phone and installs the app on your phone. Just after debugging starts, it will throw this error and not continue debugging. Make sure to enable Developer Mode -> Usb debugging like described here
https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/set-up-device-for-development