Mostrando entradas con la etiqueta Visual Studio. Mostrar todas las entradas
Mostrando entradas con la etiqueta Visual Studio. Mostrar todas las entradas

[UWP] Unable to activate Windows Store app - The app didn't start


Today, I've been struggling with a Visual Studio 2015 deploy error for a while.

When trying to debug a C# - UWP application, I kept receiving the following error upon application activation:


Places like this have information about other people finding the same error. Some of them even re-installed Windows 10 from scratch with no luck.

In my case, the cause (and solution) was much simpler than that:

I have my all my projects in an external SSD drive. Yesterday I was working in my laptop, and the last compilation I did there was in Release mode. When I brought the external disk back to my main PC today and tried to deploy directly as Debug, the activation failed for some reason.

So, going back to Release mode, rebuild, launch and let Windows activate the app did the trick. After that, I've been able to go back to Debug mode normally. 

Hope it helps.

Advanced text replacements in Visual Studio using RegEx

This is just a quick tip about making advanced text replaments in Visual Studio.

You are probably used to the "Replace in Files" tool accessible through the Ctrl+Shift+H shortcut (see below). As you already know, you can make text replacements in multiple files, entire solutions, etc.


Using Regular Expressions (you can test them first using this site), you can make quite complex replacements that are really handy when refactoring code. Especially when those changes appear in many different places.

For instance, let's say you were accessing attributes of a class all around your code. Something like:

                        nd.Attributes["ATTRIB_NAME"].Value = "ATTRIB_VALUE";                        

And that you want to change that, replacing with a call to a method. Something like:

nd.SetAttributeValue("ATTRIB_NAME", "ATTRIB_VALUE");

First, you need a way to find all appearances of something similar, no matter what's inside those strings (ATTRIB_NAME, ATTRIB_VALUE). That can be easily achieved with the following "Find What" argument:

.Attributes\["(.*)"\].InnerText = (.*);

It includes the (.*) RegEx, which basically matches any string. By using the brackets (), it will also instruct Visual Studio to tag whatever it matches the RegEx in each find-and-replace operation. That way, we can use that values in the "Replace With" argument:

.SetAttributeValue("$1", $2);

By using $1..$n, we specify found strings tagged in the "Find What" parameter. That way, the resulting replacement will include what we want, and re-use whatever was found in the original string. 

This page includes more information about using RegEx in Visual Studio.

C# Intellisense making wrong suggestions inside foreach statements

There’s a bug in Visual Studio that has been annoying me for quite a long time: sometimes, Intellisense doesn’t work well inside “foreach” statements in C#. It makes suggestions, but the wrong ones.

For example, if I start writing “foreach (System.Xm….)” with the intention to write “System.Xml.XmlNode”, Intellisense only offers stupid options like System.FromXml that make no sense.

I’ve realized that this only happens if the parenthesis are closed. So, if you delete the closing parenthesis before start typing, Intellisense works as expected. 


I´m sure there are other ways to fix this, but for now unchecking the “Automatic brace completion” option (see below) will suffice. 

In fact, it’s an option I never liked, so two birds with one stone… J


Changing UI Language in Visual Studio 2015

For some reason, I usually make the same mistake, over and over again: I install Visual Studio 2015 Community Edition using the web link provided by Microsoft. The problem with that is that the web automatically detects your system’s language, and downloads the corresponding version of VS. In my case, my PCs are usually in Spanish, so VS is downloaded and installed in Spanish. And I usually don’t realize until it’s too late…

I hate using certain apps in Spanish, and VS is one of those. I prefer using it in English, and as the installation takes ages, I decided to switch the UI language instead of uninstalling and installing all over again (which would be cleaner, I guess).

First problem is that VS only comes with one language: the one you chose when downloading. So, no English available…


So, I decided to search for a language pack, which is quite easy. The second problem is that the official MS link for that always seems to download the Spanish language pack. No matter what. Please note the installer says “Paquede de idioma 2015 – ESN” instead of “2015 Language Pack – ENU”:



Third problem is that if you try to install the Spanish language pack, it won’t detect that VS already includes that language, and will go through the whole installation process (and wasting hard drive space, I assume). It’s completely useless, as VS already has that language, and as a result VS Internationalization Options will remain the same.

So, if you want to download the proper lang pack, use this other link instead. It will provide you with the correct installer. After using it, now everything is working as expected, and it's installing the proper Language Pack – ENU.



After English UI is properly up and running, you can proceed to uninstall the previous Spanish language pack, if you want to.


Massive hard drive activity when opening the Visual Studio 2013 XAML designer

This has been happening to me since last Wednesday. Honestly, I have no idea why wasn't happening before and why it started to happen now...

I have a pretty big C# Visual Studio solution, with references to native DLLs. Part of the UI is WPF, so it involves using XAML user controls. Now, when I open one of those XAML files and the designer kicks in (you can see a new process in the task manager called XDesProc.exe), my PC almost freezes.

After checking for a while, I realized that the VStudio's designer is filling the Shadow Cache folder like crazy (in my PC it's C:\Users\XXX\AppData\Local\Microsoft\VisualStudio\12.0\Designer\ShadowCache). And when I say "crazy", believe me... I mean it... It filled like 8 GB of data in a few moments...

There are many people out there with similar problems (some say to have cleaned from that folder more than 50 GB of data). You can find more examples here, here and here

If any of you have any clue about why this is happening, please let me know. By now, I managed to workaround it by completely disabling the XAML visual editor by:

1.- In Visual Studio solution explorer, right-click in a xaml file and select "Open With"...
2.- Choose XML (Text) Editor
3.- Click on "Set as default".
4.- Click Ok.


Please note: I found several websites suggesting a similar change, but saying the the Source Code (Text) Editor would work as well. It didn't work in my case. The designer didn't open, but the disk activity was surprisingly the same. The only choice that worked for me was XML (Text) Editor.

Next time you open an xaml file, the visual editor won't kick in, and you won't have the problem. However, it'd good to find the cause for this... Maybe I´ll try to re-install VStudio 2013 when I have a minute...

Hope it helps !! :)