Does the emulator do a full reset on startup - windows-phone-8

When the emulator is closed and reopened in Visual Studio,
does it do a full reset?
I am new to programming for Windows Phone and trying to make a simple program
to save a text file.
Will a saved file be deleted everytime I do a new startup of the emulator?

As MSDN says:
Data in isolated storage persists while the emulator is running, but is lost once the emulator closes. For more info about isolated storage, see Quickstart: Working with files and folders in Windows Phone 8.

Related

UWP crashes after downloading and installing from Windows Store

I have deployed my UWP application to windows store successfully. It rans perfectly in windows phone, however, when installed in pc / laptop from windows store, it fails and crashes.
checking event viewer (windows log) shows below error;
Activation of app
AppName!App failed with
error: The remote procedure call failed. See the
Microsoft-Windows-TWinUI/Operational log for additional information.
I didn't understand what kind of error it is?
Thanks!
Have you tried yourself, with Visual Studio 2015, to run it on a Windows Phone device in Release Mode ?
Most of time, this kind of errors are due to .NET Native, which is not activated by default on Debug build but which is activated when app is published on the Store.
Thanks,
Does your app reference a portable project? If yes, does the referenced project include resource files? We have encountered similar issues and they were related to resource files. Everything worked nicely when the app was manually deployed but when downloaded from Store, the app just didn't work.
Turns out the problem was with the resource files which were inside referenced project. The problem was solved by copying the resource files from the referenced project into the app's project.

IsolatedStorageSettings life cycle in Windows Phone 8

I'm developing a windows phone 8 application. I want to store app related things like configuration settings, usernames, passwords etc. inside the application. For that I'm using IsolatedStorageSettings class.
Problems:
When I clean the project and run in on the emulator, all stored values are gone.
When I close the emulator and run it again, all stored values are gone.
Can someone please explain me why is this happening and how can I store them permanently?
This is default behavior of emulator. It is like simulation in memory to test debug app. it does not persist data/app on the emulator when you close it. And when you run the project again(emulator is not running) VS will lunch the emulator and reinstall the app again. that is why you do not find previously stored data in you isolated storage.
And same is in the case of cleaning your project. Your app will be re installed on the emulator so all the previously persisted data on Isolated storage will be lost.
In your case I will recommend to use device for debugging.
Hope this helps.

Issue packaging a Windows Phone 8 app

I just installed Visual Studio 2013 on my machine (which runs Windows 8.1 Enterprise Build 9600). I checked to include the Windows Phone 8 SDK option during install.
Once complete, I launched VS and tried a new Windows Phone App project.
Created and built fine. However. when I tried to run on the emulator, I get the error:
Xap packaging failed. Cannot access a closed Stream.
... and ...
Could not find file 'c:\users\wade\documents\visual studio 2013\Projects\DataBoundApp1\DataBoundApp1\obj\Debug\XapCacheFile.xml'. Please rebuild the solution and try again.
Tried a clean and rebuild but still occurs. Also happens with the data bound app project.
So, I tried installing some of the SDK updates found here: http://developer.windowsphone.com/en-us/downloadsdk. All installed without a problem; however, when I tried again I got the same error.
Note: the emulator starts and runs just fine. The problem is creating the phone package and deploying to the emulator.
I'm not sure how to fix. Anyone have this issue?
UPDATE:
I have tried reinstalling the Windows Phone 8.0 SDK and all the updates. I should note that I also have VS 2012 installed and I also cannot create a Windows Phone 8 app in VS2012.
Here's an image of the WP8 stuff installed:
I resolved this issue by downloading the full Windows Phone 8.0 SDK ISO and installing (followed by a repair on the two updates).
I wish I could better explain how my machine got into this state. My suspicion is it's because I already had VS2012 installed on the machine and VS got into a confused state.
Total time spent? 4-5 hours.

After upgrading to Windows 8.1, unable to run Windows Phone emulator without memory error

After I updated my Samsung Series 9 SSD laptop with 8GB of RAM to Windows 8.1, (not even a year old, and top-of-line when purchased last november), I am now unable to run the Windows Phone emulator while debugging my WP8 app.
The error messages I see is:
"Not enough memory in the system to start the virtual machine emulator
WVGA 512MB.user with ram size 512 megabytes"
Well, the instant I attempt to run a build, it the machine immediately goes from 25% memory consumed to 80% consumed. Even after I close Visual Studio Express 2012, still it is stuck at 80% memory consumption according to the task manager. At this point, I am unable to run the Windows Phone emulator to test my app.
How can I work around this issue without replacing my hardware?
Thanks!
Microsoft has now posted a KB article with information about how to edit the registry to correct this:
Start Registry Editor.
Locate the following registry subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Virtualization
Right-click the Virtualization
folder, point to New, and then click DWORD Value.
Type MemoryReserve, and then press Enter.
Double-click MemoryReserve,
enter 2048 in the Value data box, select the Decimal option, and
then click OK.
Close Registry Editor.
I can't post comments yet but I wanted to confirm being able to start the emulator after starting the Hyper-V Manager. I was getting memory errors trying to launch the emulator; I started the emulator via the Hyper-V Manager and was able to launch it from VS2013.
Closing down some applications (eg SQL Server) did the trick for me.

Launch Windows Phone 8 Emulator programmatically

How to launch Windows Phone 8 Emulator programmatically from a desktop app?
You may use the Microsoft.SmartDevice.Connectivity API to launch the Windows Phone 8 Emulator from your program code.
For further information, please see the Microsoft MSDN article: Controlling Devices with the Smart Device Connectivity API
You can find your Emulator launcher in C:\Program Files (x86)\Microsoft XDE\8.0 but the real problem isnt finding the program or even launching it pragmatically. The problem is that I think it needs a XAP file or it will not launch. If you can find a way to launch it however I think the easiest way would be from a .bat file
Open notepad
-type in cd
Go to next line
-type executable name
Save as "fileName.bat"
MAKE SURE TO INCLUDE THE QUOTATIONS WHEN YOU SAVE or it will save it as a text file and not a batch
Double click it
Another way of launching the Emulator is From the Start Panel --> Hyper-V Virtual Machine a box will pop up with the list of Virtual Machines on your computer choose the Windows Phone Virtual Machine you have on your computer and click on OK your Windows Phone emulator will launch.