VS2013 deploys Windows Phone app to emulator only after 'Rebuild Solution' command - windows-phone-8

Something weird happened to one of my C# Windows Phone 8 Silverlight projects.
It's a simple page with one TextBox I'm experimenting with, building a customized style for it. First I placed a TextBox on the PhoneApplicationPage, generated a style template for it using the 'Edit Template\Edit a Copy' command from the context menu in the designer. Now I'm changing some setters and property values in the style, but when I hit F5, an old version of my project is launched in the emulator - all my recent changes aren't taken into account. The latest changes are reflected in the launched app only after I issue the 'Rebuild Solution' command from the Build menu.
The XAML markup has no errors, and it seems all stuff is correct. Other WP8 projects are built and deployed to the emulator ok too. The problem does not depend on the selected emulator (WVGA 512Mb, 720p, etc). Restarting VS/emulator has no effect too.
What it can be and how to fix it?
Some more info. For any normal project I see this in the Output window when I hit F5 (the app full path was shorten to save space):
But for the problem project, the output log ends on the line '1> Xap packaging completed successfully' and the old version of the app is opened in the emulator immediately.

It seems, I have managed to find the reason of this strange issue. This can happen if the name of a WP app includes spaces! I noticed that if we create a new project and use the space character in its name, the spaces are replaced with the underscore characters on the phone (for instance, "WP Test App" is deployed under the name "WP_Test_App"). I also found this while searching for a solution of this problem:
App doesn't get updated then debugging - incrmental update not correctly working?
I played a little bit with the names of my project and solution, i.e. removed the spaces in them, and it helped to solve my puzzle.
BTW, as the author of the question under the above link states, this problem never occurred in the WP 7.1 SDK - it is specific only for the WP 8 SDK.

Related

TFS 2015 Code Viewer Not Working in Google Chrome

I found the following issue here in stackoverflow however cannot comment as yet. I have a similar issue and wonder if there is anyone out there that has solved it.
https://stackoverflow.com/questions/40917501/tfs-2015-web-portal-code-viewer-not-working#
I am encountering similar here. In house TFS 2015, can't view code in the web portal using Google Chrome however IE is fine. I, however, am not using HTTPS so may be experiencing something slightly different.
When I do try to view a file in Chrome, the window where the code listing should be is simply blank. I did note too that the button for creating a new build definition appears to be indicating a broken image link.
This has not always been an issue. Around 4 months ago I could get the code view fine in Chrome and, to my knowledge as I have no access to the servers, nothing has changed apart from Chrome updates.
I've tried getting to previous versions of Chrome to no avail, though I wouldn't know which version I was on when this did work.
Interestingly, I have one or two .MD files around and these display perfectly well. They are simple text files. However when saved with .TXT extension (or anything else I've tried), they do not show. Curious.
Update
As you will see from the screenshot below, when selection on a file has been made, in this case a .SQL file, where I would expect the view to populate nothing at all appears.
As for the F12, I do get 5 of these:
Failed to load resource: net::ERR_CONNECTION_REFUSED
plus associated paths of course. We use Webroot internally here which has recently dropped in a Chrome extension however even when Webroot is disabled in its entirety (including removal of extension) I get the same behaviour.
All other Chrome extensions have been removed too at varying times to try to give a clean browser.
I have no other pop up blockers, ad blockers, etc installed on the workstation.
Problem solved thanks to the F12 key suggestion.
After some grovelling I was granted domain admin privs to have a dig around everything. It turns out that TFS was installed on ServerA with a URL port of 8080, this I knew from the original install and obviously the path I follow to get to my TFS web interface. What had also been done subsequently, with no consultation of the Dev user group, was that a second TFS application tier had been installed on ServerB, the port here was 8088.
I had not noticed the difference in path initially, assuming it was Chrome or workstation related. Anyway, I altered the port on ServerB to 8080 and everything jumped into life. I should not have made assumptions and should have paid more attention to the path in the error!
It seems the second application tier was set up on a non-production environment to allow senior Dev users access to the TFS Management Console rather than allowing them access to the original app tier which was on a production box. Our IT Operations just forgot to tell anyone.
Try to update your chrome to latest version of (55.0.2883.87 m (64-bit)).
Also clear the cache of chrome. I have also encountered similar issues. The solution is clear cache and connect to the web portal use another ID, then connect back use the original ID. I have no idea which one solved the problem. You could try both.
This problem should only be an individual phenomenon, since TFS2015 has been released for a long time.

MissingManifestResourceException on Windows Phone 8.1 with .resx resources

I'm developing a Windows Phone 8.1 app that also targets Android(Xamarin)
As ever I added my string resources(.resx) on a PCL and referenced them on my launcher project to use it on my views, this all works fine on WP 8.1 silverlight but on the WinRt when I configure the project to release and run it on a device, for some reason I always get a MissingManifestResourceException. I've tried every solution for this problem out there without any success.
Note that on the emulator everything works fine, when the solution configurator is set to Debug it also works on both device and emulator. The only combination here is device and Release.
The app source code is on Github.
I was able to create a simple project to replicate this issue, basically it is a WP 8.1 app and a PCL project with the embedded resources, Download Link
Anyone has any ideas?
EDIT: After making some more testing I tried running an old Windows 8.1 app that I've done with the same localisation model and the same issue appeared so it seams to be a tool issue and not a configuration issue, since the Windows 8.1 app is on the market and everything went fine back there.
Our team ran into a similar issue which was tracked down to the runtime and not the PCL, WinRT component, or application package. That is, the resources exist within the PCL assembly, within the application package resources.pri file, but just cannot be found at runtime.
There is an active Microsoft Connect report here:
https://connect.microsoft.com/VisualStudio/feedback/details/991028/issue-using-resx-files-on-winrt-apps-windows-phone-and-windows
Our workaround was for the WinRT component to inject into each generated Resources class of each referenced PCL our own derived ResourceManager which redirected the call to the WinRT ResourceLoader instead. I've written a blog post that describes that workaround:
http://blogs.msdn.com/b/philliphoff/archive/2014/11/19/missingmanifestresourceexception-when-using-portable-class-libraries-in-winrt.aspx
I got to the bottom of this today. While bundling the app package, resources in dependencies that are not for a language being used by the app are stripped out. To prevent this from happening, add the following assembly-level attribute to your application.
using System.Resources;
[assembly: NeutralResourcesLanguage("en")]
I had the same behaviour. Today I created a new PCL Library (with another name) and copied the resx file to this project. I modified all references and everything just works fine in my WinRt (Windows Store) App now!
There was the string 'resources' in the portable class library name. Perhaps this was the problem!
I am able to reproduce this issue launching DVD sample and unfortunately in my project. I have an WP Silverlight 8.1 project registering a Windows Runtime Component Background Task and both of them using a Portable Class Library sharing some common localized strings as resources (.resx), among other things. The exception is thrown from Background Task when calling any property to get strings on generated .Design.cs class (only Release + Device).
In order to fix this I tried, without success, to use directly ResourceManager and/or to add .resx files directly into the Background Task.
I ended-up porting needed strings to .resw files and use the new "WinRT preferred" way via Windows.ApplicationModel.Resources.ResourceLoader in the Background Task project.
Seems to me that ResourceManager is not compatible with Windows Runtime anymore in release.
This is not necessary an answer, but is better than nothing since I do not have 50 reputation points for a comment.

FileSavePicker and deprecated ApplicationViewState

In the documentation for the FileSavePicker, it states:
Warning If you try to show the file picker while your app is snapped the file picker will not be shown and an exception will be thrown. You can avoid this by making sure your app is not snapped or by unsnapping it before you call the file picker.
I'm currently checking to see if the app is snapped or not, and my app responds differently in each case. My default behavior isn't showing the FileSavePicker, either, so I can't just try and then fall back to something else. Nor do I want to force the app to unsnap.
However, ApplicationViewState is deprecated post-8.1. In that documentation and related searching, developers are advised to access the window size directly in order to determine proper behavior. However, if the view state is no longer available, how do I know if the file picker will throw an exception or not? At what size is the app considered 'snapped'?
Also, I'm using C++, so an answer compatible with C++ would be splendid. I wouldn't mind seeing the C# solution, too.
In regards to the FileSavePicker documentation - I believe that it is just an oversight. The text you quote was from the Windows 8 version, and to me it looks like it didn't get updated for Windows 8.1.
If you look at the FileOpenPicker documentation, you see that it was updated:
Important In Windows 8 if you attempt to display the file picker while your app is snapped, the file picker will not be shown and an exception will be thrown. You can avoid this by making sure your app is not snapped, or by unsnapping it before you call the file picker. ...Note that Windows 8.1 does not define a specific snapped window size. Instead, users can resize apps to any width, down to the minimum. Therefore, if your app will deploy only on Windows 8.1, you can ignore the EnsureUnsnapped function and calls to it in this topic's example code.
The last sentence (in bold) above essentially says that you can ignore state and safely open the file dialogs if you are running under Windows 8.1.
To test the above, I used VS 2012 to create a Windows 8 application with a file save picker (in C#). I believe the outcome will be the same with C++, but I am not 100% certain.
I should note that my test application does not check for view state and always tries to open a file dialog.
When the application is run under Windows 8 in the snapped state, the application causes an error. That same application (same binary) when run under Windows 8.1 allows the file save dialog to open without issue. As mentioned previously there is no snapped state in Windows 8.1, so the way I tested the application was to open the application to the minimum width (320 pixels).
To summarize:
If you are targeting Windows 8.0, you will have to make sure the application is unsnapped prior to opening the file picker dialogs.
If you are targeting Windows 8.1, you do not have to worry about state, as the file picker dialogs no longer throw any exceptions.

How can I access a local HTML file on Windows 8 Phone?

I have been following this guide on displaying website pages as an app (http://antonylees.blogspot.co.uk/2013/02/launch-website-as-mobile-app-using.html).
Everything works apart from trying to access a local HTML file as a fallback option when there is no internet connection. I have researched and tried multiple methods to try and do this without luck. The 'This app requires an internet connection' popup works fine, but when trying to load the local HTML file, I either get a grey screen or the 'Page cannot be found' message.
The suggested way is:
window.location="local/index.html";
I have also tried:
window.location.href ="local/index.html";
and:
window.open('local/index.html');
The 'local' folder is a sub-folder of 'www'.
Is there something specific to Windows Phone 8 that I am missing? Any other ideas?
I am using Visual Studio 2013 Express, The latest version of Cordova, and live debugging on a Nokia Lumia 820.
Solved! The problem was completely unrelated to Cordova etc.
I am new to MS Visual Studio and this was my first project using it. I noticed that the local HTML file I was trying to load was not showing in the Solution Explorer. I realised that I had created the file externally of MSVS. As a result I had to right click in the solution explorer and add an existing item. Once I had done that everything worked fine using the same code as in the tutorial. I am guessing that the compile process only includes files listed in the solution explorer.
Thanks for looking anyway! And at least I now know how to display code correctly in Stack Overflow ;)

restoring windows phone 8 app after minimizing

i have developed a windows phone 8 app, everything is working fine except one.
when i minimize the app and press back it restores everything and starts from the same page.
but, if instead of using back i press app icon it starts from the very beginning.
i have tried editing app.xaml.cs but i'm not very familiar with windows development so i undid everything.
i refered this link :
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff967547(v=vs.105).aspx
how can i fix it? please help.
Any App will do this as long as you didn't support Fast App Resume.
To read more about Fast App Resume
http://msdn.microsoft.com/library/windowsphone/develop/jj735579(v=vs.105).aspx
You can check this sample (Fast App Resume Sample)
http://code.msdn.microsoft.com/wpapps/Fast-app-resume-backstack-f16baaa6
It is not a difficult thing , just follow the steps , tell me if you have any problem