Application silently terminates at launch Windows Phone 8 - c#

I created simple WP8 application with database and I am having problems trying to submit it to store. Application is quite simple it allows to search through database that I attach to application. Everything works fine using all emulators and Lumia 620, but I am unable to successfully submit it to store. When I set my Database.sdf Build action to Embedded Resource I get following certification error:
The application cannot be tested for compliance for Windows Phone Application Certification Requirements because it fails
to launch on all Windows Phone devices. The application silently terminates at launch.
But when I changed Build action to Content application passed certification and was published to store. To make sure that everything works fine I downloaded it and was unable to run it, it closed immediately...
I managed to reproduce this error by opening MyApplication.xap and renaming Database.sdf to something else. So I think problem is with encryption and I should reference database in code differently, but not sure how. Any ideas ?
DbDataContext context = new DbDataContext(#"Data Source = 'appdata:/Database.sdf';");

Related

Xamarin UWP app won't install for multiple users

I have created a Xamarin UWP app and installed it on a company PC, all seems fine. Multiple people log on to these PC's however and it seems that only the person who installed the app can access it. I can't seem to find it on any other user account.
When I try to install it via a different user account I get a 'Catastrophic Failure (0x8000ffff)' error from the appinstaller.
Pretty stumped about this as we need multiple users to be able to access the app on the PC, either using the same installation or an installation per account.
Okay just in case anyone stumbles across this,
I needed to run the supplied install PowerShell script, instead of the appinstaller.

Deployment to Remote Machine failed - UWP Debugging

I am currently attempting to deploy an app to a Windows 10 tablet running the Creator's Update, over my local network. When I select remote machine and enter my debug settings, I can discover the tablet on my network, and get its address and Authentication mode automatically.
However, when I try to deploy, I get this error:
DEP6957 : Failed to connect to device using Universal Authentication. Please verify the correct remote authentication mode is specified in the project debug settings. 0x8007274C: The network event being waited on triggered an error.
As far as I can tell from the documentation that I've read, this process should be more or less plug and play since the Creator's Update, can anyone explain what I might be doing wrong, or what might be going wrong?
Listed here are my debug settings currently in use.
Update: Since its not the solution I was looking for, I'm not adding it as an answer, but if anyone comes across this looking for a fix and no one has suggested one, the way I ended up working through this is just downloading the remote debugger to the tablet and running the old method for C# apps. I never did find out why the UWP method didn't work.

Losing data/files after app closes Xamarin Forms

I am developing a crossplatform app with Xamarin and got stuck with this problem.
Every time I launch my app, all the data I had saved before is lost.
To give more details, I am using SQLite to persist some information and even storing some image files in the app's default directory. When I am running the app, I can persist everything successfully and even retrieve the data that I just persisted. But if I close the app and relaunch it, all the information and the files are gone.
To get the directory, I am using the code below, which is suggested in the Xamarin tutorials.
string documentsPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
var path = Path.Combine(documentsPath, sqlite Filename);
At the moment I am focusing my tests on the Android, so I don't know if it happens on the other platforms. I am also using the Trial License, maybe it is some limitation related to it.
I am also using Visual Studio 2013.
Does anyone have an ideia about it?
thanks
If by "launching app" you mean starting new debuggin session from VS just go to Tools - Options - Xamarin - Android Settings and tick "Preserve application data/cache on device between deploys" option.
Xamarin Studio should have same option somewhere.
If you are developing the app on VS and deploying it to a test device the data may not persist as I explain below.
What I discovered is that when I close the app on the phone (at least on the iPhone 12 I am testing with) and then reopen the app by launching it again on the phone, the data persists.
Now, if I then relaunch the app from VS the data still persists. Good.
However, when I make a change to the app I find that I need to eliminate the app on the phone for VS to install the new app. It is annoying, but I have gotten used to deleting the app on the phone before launching it again in VS. In this case the data does not persist. Removing the app on the phone removes its data as well. This all makes perfect sense but it was confusing when I first started testing my app with sqlite.

WP8 Xamarin App hangs on SplashScreen on First start

I have a strange situation. My windowsphone 8 app build with Xamarin and MvvmCross runs perfect from my debugger (visual studio).
Then I submit the app to the app store (beta store by the way). After that I downloaded it on my device and started the app. The splashscreen shows off... but thats it (I waited for about 5 minutes). No crash and no other information about what happens.
When I then go back with my backbutton or my start-button and restart the app. Everything works fine. This situation only occurs on the first time I start my app after downloading from the store.
Question: Is there someone with same issues?
Question: Is there a tool or something which I can use to log the device to get some more information?
Thank you
Assuming you are submitting to the Windows Phone App Store and the OS on the phone running the app is greater than v7.0.7355., you should be able to retrieve the crash dump data from the Windows Phone Dev Centre.
This will only cover crashes within an application and not the underlying OS code.
For more information see: Crash count reports
Check you don't have any code in the debug-only section of the App.xaml.cs
e.g. if your init code sits inside a block starting if ( Debugger.IsAttached )

Web browser print from service running on windows 2012

We have a automated printing service running as System account printing web urls.
The idea is using WebBrowser to load page and call Print upon it finished loading.
This works fine on Server 2003 , 2008r2 etc but does not work on Server 2012 ONLY IF it was running as a service. running as a console application works fine.
The problem:
It would load web pages fine and would call Print() , Print() will return but nothing gets printed on the default printer: no print job at all.
I thought it would be account problem so I tried to run service as the same logged on user but still does not work, if that user run application as console app then it would work fine. So default printer and user account get ruled out.
I don't think it is a code problem (it must be though) as it works for older Windows versions running as service.
It seems something fundamental got changed for a service process in server 2012.
Update 1. It may relates to How do I print an HTML document from a web service?
However it works fine for me prior server 2012.
Update 2. It does not work even the whole print happens in a separate process, i.e. my service launches a process to do print, it does not work either. Everything works fine if I run same code in console mode. It is definitely not a threading problem but rather something deep in server 2012.
Now the questions are:
What is changed? Why it stopped working?
At http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/fdcfa0fa-50aa-4a61-be79-5b4c8f65fbf7/ we see that this was reported to Microsoft and confirmed as a bug in Windows 8 and Windows Server 2012.
This bug is triggered when trying to print from a 32bit process in non-standard user session (like e.g. a service).
According to Microsoft, this a bug was resolved in Windows 8.1 and Windows Server 2012 R2. However, we could still reproduce it on Windows 8.1.
On the same site, a workaround is given by Microsoft. This workaround solved the problem for us on Windows 8.1. It probably also works on Windows 8 and Windows Server 2012.
The workaround goes as follows:
Open Regedit and go to HKEY_CLASSES_ROOT\CLSID{BA7C0D29-81CA-4901-B450-634E20BB8C34}
Check the value of the "AppID" Registry Entry. In our case this was {AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0}
Now go to HKEY_CLASSES_ROOT\AppID{AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0} (or the respective value you found on your system)
Under this registry key, delete the entries with the name "AccessPermission", "LaunchPermission" and "RunAs"
Since this is a bug in Windows, you cannot fix it in your code. The workaround might have side effects, but we haven't seen any so far in our scenario.

Categories