Enabling editing code while the app is running in Visual Studio (WP8) - debugging

I am developing Windows Phone 8 apps with Visual Studio and not being able to change the code while the app is running makes me crazy. I fall for it everytime. Trying to change the code before stopping debugging.
Tools > Options > Edit and Continue => I unchecked Enable Edit and Continue.
With above steps, I was able to change the code while the app is running but now I can't change design. How can I enable design editing while the app is running, too?

There is a very simple way of editing the design without ever running the app. If you open your solution in Blend, you can app sample data to your bound views based off the classes that they bind to. Then when you make changes in the XAML, they will update in the design view with the sample data.
http://blogs.msdn.com/b/pakistan/archive/2013/08/29/using-sampledata-in-windows-phone-8-using-blend.aspx

Related

Blazor app requires server restart every change I make

I'm developing on my localhost a new Blazor server-hosted app. I launch the template that it starts you out on... looks very nice. I change the text in the tag, refresh my browser... and no change. I refresh and refresh only to notice no change. Is something wrong?
Then I rebuild and rerun the app again and the change happened. Why do I have to restart the entire server for a small front-end change? I have to do this on every change I make? Even though the changes are for the front-end? If so, then the development experience for MVC apps is way better. I don't have to restart my server for changing the code for the front end.
I know dotnet watch exists, but it doesn't help. It still restarts the server for every change I make for the front-end. I have to wait like 10 seconds for just changing some CSS? Please tell me if I'm doing something wrong, or if this is by design.
Also, I tried the web-assembly version of Blazor. Same results.
I guess you are running the app with the debugger connected? this prevents the recompilation. You need to:
Press Ctrl-F5 to run the app without the debugger.
This should work on Windows using IIS, but on Mac "it's a bit more complex". According to a MSFT representative, they are planning on enabling this functionality for Mac users, but this info is already over a year old (from April 2020).
This issue still happens, and for me is a major downside. It doesn't make any sense to have to recompile entire project just because I changed some text on a page. If this is a design choice, it's doomed! Can't have a designer dependent on developers to recompile whenever a small change is required on simple html! Even if you change an element style you have to recompile!

Refresh Xamarin View while debugging without rebuild of app

In Visual Studio (2015) using an Android Emulator, is there a way I can make a minor update to a xaml view, and have that refreshed in the debugging application without having to rebuild and re-deploy the project?
Currently a build/deploy for debugging takes about 2 minutes, and having to make some minor UI style tweak and do the whole thing again is driving me nuts.
I suppose I'm asking if there's some ASP.NET MVC-like functionality where I can update a frontend file (cshtml, js, etc) and just refresh the page without reloading the project.
Xamarin Live Player lets you make live edits to your app and have those changes reflected live on your device. Your code runs inside the Xamarin Live Player app – there is no need to set up emulators or to use cables to deploy the code!
https://www.xamarin.com/live
It does have limitations, be sure to read the Limitation section:
https://developer.xamarin.com/guides/cross-platform/live

My windows phone application runs when ran though visual studio (onclick of device button) but when I disconnect and run it doesn't?

I have written file picker code in my project. When i run the project in my windows phone by clicking on device button in visual studio, the app runs fine(I mean it opens pictures library and i can select a photo and preview it).
But when I disconnect my usb and then open the app in the phone and when i open pictures library on click of a button , the pictures library opens briefly and then the app crashes immediately(My app closes).
Can anyone please help me with this??
As written in the blog post , the AndContinue method run in a different process and to do so, the current running app goes into the background or even gets closed sometimes, that is what you are experiencing in your app as far i can tell but not sure why different things happening during debug & deploy.
There must be a callback inside app.xaml.cs specifically to handle the condition when calling application(which was sent into background) comes in foreground, read this blog post carefully & you'll understand as what you need to change in your code :
using-the-andcontinue-methods-in-windows-phone
http://blogs.msdn.com/b/wsdevsol/archive/2014/05/08/using-the-andcontinue-methods-in-windows-phone-silverlight-8-1-apps.aspx
I just dealt with this issue and one of the reasons why there are differences between debug and deploy is because of the suspending event.
During debug, the application does not actually get suspended until you manually do it through Lifecycle Events. This means that when you pick a file on debug and the app is put to the background to load the file picker, it is not actually suspended, while when the app is deployed, it actually gets suspended.
Look into your app_resuming method and OnSuspending methods in your app.xaml that may be causing errors not occurring during debug.

WP7 app won't launch from app list

I have a simple Windows Phone 7 application which is working perfectly when started from Visual Studio. However, if I deactivate the app (press Windows button or back button from the application's MainPage) and then click the app's icon to relaunch, the screen will flash and return to the list/home screen. I assumed this was an issue with the emulator but when I got a developer device I have the same issue.
Note that reactivating without a complete tombstone works (pressing Windows button from the app and then back).
I have no idea what causes this or how to proceed with debugging. Hopefully someone else has experienced this and knows a fix.
Turns out there is a bug, i found the solution here http://forums.create.msdn.com/forums/p/67522/416995.aspx
In short, it turns out that the Microsoft.Xna.Framework.Media.MediaLibrary class (which I am using to display pictures on applications main page) is not properly initialized when the user has not opened a media hub prior to you calling it. So picture collection properties are null or empty. The solution is to add a call to MediaPlayer.Queue.ToString(), it will force the initialization of the native media library allowing you to invoke the MediaLibrary later on.
Sounds like an unhandled error on startup is causing the app to crash.
Trap/log/handle/display any unhandled exceptions. Also check what you're doing on startup.
IF you are saving something (to Isolated Storage) after first run and then opening it on subsequent launches then that's where I'd look first.
If it works when launched from Visual Studio then this will probably be due to the way you are rebuilding/redeploying the app before launching it in that case.

Screensaver to cycle through webpages?

Does anyone have any suggestions for how to create a screensaver that can cycle through some webpages? I would like to create a screensaver that displays various dashboard and statistics pages that are available in our Hudson CI server. This is a windows machine, with firefox and IE available.
Extra bonus points if I can do it in ruby! :-)
Cheers,
Mike
I programmed a lot of screensavers in Delphi, but I think the following should be applicable to all sorts of development environments.
You create the main form of your screensaver and put an IE-control on it (or if your development environment does not support it, an OLE-container) and then create a timer which changes the webpage shown by the IE-control.
Sorry no solution in ruby....
Ok, so after a few false starts I found a pretty simple solution. I used Visual Studio Express Edition to create a windows forms application. You just need to drag a WebBrowser control onto the form and resize to full screen at startup. Then all you have to do is hook up the event handlers to deal with the mouse and keyboard.
Some more details here:
Blog post on how I made the screensaver
Source code on github

Resources