Xamarin App mode Release no found conexion sql - xamarin

develop an app that contains a connection to a database in sql, in debug mode it works correctly, but in release mode it does not load the SQL data. Already try putting internet permissions in the manifest. Help!!

you could try to disable Linker.
If something works in Debug mode but does not in Release mode then most likely the issue is that the Linker is not including your dll when it generates the Release binary.
you could right click your Android project,then Properties -> Android Options -> Linking -> None
If you select "Don't Link" all dlls your project reference will be include in the Release binary. This will lead to a larger binary size but will help you diagnose if this it the problem.

Related

Xamarin application crashes on startup on release mode

as I said in the title, my application simply works fine in debug mode, but when I extract a release mode apk it just crashes on startup.
I have tried every possible fix I could found on google and none worked, that's what I tried so far:-
Setting linking to None / SDK Assemblies Only.
Setting code shrinker to None / ProGaurd.
Enabling support architectures armeabi-v7a and arm64-v8a.
Adding Internet permission.
Cleaning the whole solution and rebuilding everything.
Setting projects assemblies (PCL & Android & IOS) to lowercase names fails the archiving.
Enabling the Use Shared Runtime fails the archiving.
Enabling the Bundle assemblies into native code.
Uninstalling the Mono Shared Runtime from the device.
I also cleaned the solution and did a rebuild after each of these tries...
Nothing worked...
What am I missing here ?!
Thanks in advance ^_^
As #MohamedAshraf mentioned, when he tried to build it on an emulator in the release configuration, the app still crashed.
So, he was able to enable debug symbols and debugging in the release configurations as well, and was able to catch the exception and fix the issue.
Don't forget to turn debugging off in the release config again afterwards.

UWP Unable to debug .NET compilation code (Release)

My UWP apps were running flawlessly on debug but instant crash on release, I've uploaded the package to app store twice and they tell me that my app doesn't work too. Unticking that .NET Native stuff helps but I'm not sure it will work on other users' pc and I have no idea what that does, I think something goes wrong.
My other projects can run Release build flawlessly, I've tried clean up everything and re-build but I get the same error.
Thank you
edit: tried running on my laptop, stuck at splashscreen then got the same error, I even tried removing anything on MainPage constructor and OnNavigatedTo.
Running flawlessly on debug but instant crash on release:
Unticking this helps:
I found the solution, I think this is a bug where Visual Studio passes command line to compiler which I suspect they forgot to put quote "" to cover the path.
Project with spaces in path
Project without spaces in path
Be aware that spaces must not exist neither in the path to the project file nor in the Assembly name.
Your app should be able to run on .NET Native because it will be compiled that way in the store (before users are able to install it).
Release builds do have code optimizations enabled, which will make it harder to debug. If you want to debug .NET Native, you should disable the optimizations.
For the full guide on debugging .NET Native, check the msdn article. I hope this helps in hunting down the actual problem (which can be plenty).

NVIDIA Visual Profiler, Debug and Release modes in Visual Studio 2010

I'm new to Visual Studio 2010, as I was used to compile my CUDA codes with nvcc using Linux as operating system. Incidentally in some posts of this and the NVIDIA Developer Zone forums, I have read warnings on proper compilation in Visual Studio (Debug/Release modes, see link for the difference between the two) to correctly use of the NVIDIA Visual Profiler. In my (poor) understanding, Visual Studio automatically compiles under a "Debug" mode, but for a successful profile the "Release" mode is necessary.
My (simple) questions are:
1) How do I switch from the "Debug" mode to the "Release" mode? Is it enough to use Properties -> Configuration Properties and select "Release" instead of "Active(Debug)"? Also, I noticed that I have to repeat the selection each time I want to Rebuild the project.
2) Is this enough for a correct usage of the Visual Profiler?
Thank you very much in advance.
1) You're switching from Debug to Release in the wrong place. The setting you're using is just for selecting which build settings to view or edit. You should use Build | Configuration Manager or (easier) the Solution Configurations dropdown box in the Standard toolbar. If you don't see the Standard toolbar, right click in the toolbar area by the menu, and select it there. You will find that you don't have to reselect the setting for each build now.
2) The CUDA compiler optimizes aggressively even in Debug mode. I don't know if it matters which configuration you use. Both should work. You can try and see if you get any different results.
See Roger Dahl's answer for how to set the configuration.
There are several forms of profiling.
Performance Profiling
This should definitely be done with optimizations enabled on the CUDA kernel. Disabling optimization and specifying debug information performs more operations than a CPU but it does do other modifications to the code (stack overflow checks) that will impact counters.
Source Level Profiling
This can be done on Debug or Release builds. Nsight 3.0 CUDA Profiler has source level experiments that will show statistics per C source, PTX, or SASS line. The CUDA 5.0 Visual Profiler supports code correlated experiments but will not show the results for every line (only problematic lines). Disabling optimizations will result in significantly more accurate line information for the SASS to PTX to C code mapping. For many analysis cases this is fine. However, if you want to understand the code generation per C line then you should enable full optimizations and heavily look at the SASS code and only use C source and PTX as a guide.
In order to get C source level correlation you need to use the default debug configuration which generates full debug information or use a custom configuration that enable -lineinfo. This option can be enabled using the following steps:
Open Solution Explorer
Right click on your .cu file or project file
Execute the Properties command
In the left pane select the tree node Configuration Properties | CUDA C/C++ | Device
In the right pane change Generate Line Number Information to Yes
In CUDA 5.0 -lineinfo has several small impacts on code generation so it is not advisable to keep this enabled in your Release configuration.

Breakpoints not working in xcode 4

I just started using Xcode to program a C++ openCV project.
The project is set up with an external makefile, /usr/bin/gnumake as build tool, and the program compiles and runs fine.
However, breakpoints gets skipped no matter what i do.
I have tried making a new project, selecting between gdb and LLDB, restarting Xcode++
There are numerous threads about this issue, but most talk about "Load Symbols Lazily", but as far as I know, this is not an issue in Xcode 4.5.2.
It is probably my limited Xcode knowledge that causes the error.
Help is greatly appreciated.
I could resolve my similar problem by disabling "Link-Time Optimization" for the Debug build settings.
Make sure that any kind of code optimization is disabled in your debug build settings (code stripping, optimization, etc). Then check that you really run the debug build and not the release version.
It would be great if XCode could automatically warn you when you have build settings that possible break the debugger...

debugging in c++/cli assembly vs2010 debugger show all native fields are <undefined value>

Has anyone seen this/knows how to get the values in debugger local/autos window?
The project is a c++ project in a c++ solution. The dynamic lib is build wity /clr.
Due to the nature of the dll i can only debug it by attaching to a third party native process that loads it.
One interesting thing is that prior to including clr in these type of dlls when i would attach, in the output window i would get a list of all dlls loaded into the process, those would be c++ runtime sdk dlls, the third party native proc dlls and my dlls. Now I get only clr related dlls in that window + mine. All the runtime native dlls no longer get listed in that window. Its almost like the debugger does not load them for reference.
Found the resolution. When creating mixed mode assemblies in the manner describe in the question, it does not matter what debugger one uses in vs2010. The ide will autoselect the right one. Further more if your attaching, you can use both at the same time .net+native selectable in a combo box list in the "attach to:" section of the Attach to process dialog.
What you absolutely have to make sure of is to link with these 3 options: /MAP /MAPINFO:EXPORTS /ASSEMBLYDEBUG located in the Linker/Debugging section in project properties.
Per MSDN forum post.
Disable the setting:
Properties -> Configuration Properites -> C/C++ -> Optimization -> Optimization: Disabled(/Od)
Enable the setting:
Properties -> Configuration Properites -> Linker-> Debugging-> Generate Map File:Yes(/MAP)

Resources