Visual Studio 2015 XAML files freezing - c#

I've recently updated the version of VS from 2013 to 2015. I work on WPF and obviously, I have to modify *.xaml files; every time I leave a .xaml file Visual Studio freezes for about 15-20 seconds. I cannot work like that! I've uninstalled Reshaper, but no change. I've closed even the designer process, but still - no success.
When I try to run VS without administrative rights it freezes even more (about 30 seconds). If I try to open the same solution with VS2013 it works very well.
Station details:
12 GB RAM,
i7 2.5GHz,
SSD,
Windows 10 x64
Does anyone face the same problem? How to solve it?!

It is not a plugin problem, VS2015 seems a little buggy to me. You can update to the latest version (Update 3), which works much better for me.
I think the problem is that VS added support for many different frameworks in a short amount of time. It's normal that the version is buggy, but I'm sure they will solve it with the updates.

If you can work without designer, try opening and editing just the source (XAML) code. Personally, I find it easier to work with XAML source and intellisense than using a VS XAML designer.
To do this,
right click on a XAML file
select Open with...
select Source Code (Text) editor
if you like this mode, click Set as Default to always open just XAML.
If you need designer later, you can open in designer mode by selecting XAML Designer or Automatic Editor Selector.

"was having similar issue with 2015 pro. During the simplest of changes it would take forever. What I did was go under debug\options\web forms designer\ (turned off refactoring). This solved all my issues, not there is no delay while working, only when I do a build or switch to another section or form, it will write all changes at once."
source: http://blog.geocortex.com/2007/12/07/slow-visual-studio-performance-solved/

Related

Winform cannot be edited without fully breaking layout (2017 to 2015)

As I left home for a weeks holiday I decided to quickly zip+copy a project I have been working on from my pc to my laptop. It is a c# winforms application that I have been creating on my PC using visual studio 2017 community.
My laptop however uses visual studio 2015. If I just open the project on my laptop and run it, everything is fine. However the slightest change to the form (IE anything that causes it to save?) and when I run the application half my controls now anchor off the right hand side of the screen and are out of view.
I can restore the project back to working by replacing Form1.designer file with the original from my zip and rebuilding - but again any changes after that break it in the same way. The bizarre thing is the form looks absolutely perfect IN the designer, both when opened and unchanged and after changing regardless of how it looks when the program is executing.
Completely baffled and thinking I'm going to lose a week of leisurely work - any ideas as to what may cause this? I could try installing 2017 to see if its a going backwards problem but the free wifi at my location is.. lacking.

Visual Studio with Xamarin rendering display in designer taking a long time

I've been trying to put together a simple Androind app so that I can get familiar with Xamarin inside VS2015. When I open the default Main.axml file it renders in the designer properly and I can drag buttons and other items to it. But if I switch to source and then back to the designer it never renders again, the progress bar just sits there spinning.
The only way to render the page in the designer is to shut down VS2015 and restart it. The design will work until I try to switch to source and back again.
Using VS 2015 on Windows 10
After an email exchange with Xamarin I have installed their beta version. The problem appeared to go away and everything worked properly. Unfortunately it still happens just much more infrequently.

No WPF User Control Library Template found in VS 2013

I am using VS 2013 (Express Version) and I want to create a WPF user Control Library project. But I am not able to find the template in my installed templates list. If I use Winforms, I am able to build a DLL out of my Winforms Application Project just by changing the Output type as "Class Library". But it is not happening in WPF and it is throwing errors if I do so. Is this the correct method of doing it or am I going wrong?
And in the Create New Project dialogue window, I am not able to find the .NET Framework selector drop down. After creating the project only I am able to change the .NET framework version by going inside the properties of the project.
Kindly help me to get out of this. Thanks in advance.
I have been working on this exact same problem for hours this morning. Here is what I think I have learned:
With Visual Studio Express 2013, it is by design that the WPF User Control Library template is not available for making a New Project. This is because it is the free Express version.
With the Express version, you don't have a "devenv.exe" for trying the "devenv /installvstemplates" to "fix" things. It is, instead, called (just a moment while I look this up again...) "WDExpress.exe" and will be located (if you have default location) in the "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE" directory. BUT - this won't help you. It won't fix your problem, because, as I mentioned, your Express installation is designed to not have that template available for New Project, so your "fix" won't put it there. I know this because this is what I tried myself. (Also, note that the instructions for doing this tell you to uninstall any extensions you've installed before doing it. And then, of course, if you still want them you have to reinstall them. Like I still have to do, incidentally.) I'm letting you know all of this so you don't go through the headache I'm having.
Note that I have not done this yet, so this is somewhat hypothetical on my part, but is based on my research on the Internet so far - Your solution is to create a WPF User Control Library manually [but now see UPDATE below]. (No, I don't know how to do this yet. I got into this in the first place, because I'm a WPF novice - just started working with it a few days ago - and late last night I got this great idea to add a "spinner" progress indicator to my "WPF play/learning project" I'm working on, and found a couple of relatively easy-to-work-with samples on the Internet - both of them are a WPF User Control Library - and at first I wanted to use the copy-and-paste to put the code in. But then I discovered... well, our mutual problem, because I'm using Visual Studio Express 2013. No such template under New Project. And literally at the tail end of my about-to-throw-in-the-towel, I'm googling and your post, Dhivakar, is already showing up with the right Google search.) So I haven't finished my research yet, but my next step is to learn exactly how to create a WPF User Control Library manually (the code and various project property settings), and then I can just save a WPF User Control Library skeleton for future use and document the details.
UPDATE: This guy totally has the solution for Express versions. I have followed his steps and it works great. The only additional piece of information I would add is that in my version (VSE2013), after you've created your WPF User Control Library template, when you open Visual Studio again and use File -> New Project, my selection in the tree (for a Windows app) came up under Templates -> Visual C# -> Windows (which is what I've been using). I did not see my template showing up there, after I created it, and I thought, "Great! Another piece of advice that doesn't work." But then I clicked up one on the "Visual C#" parent - and there was the template!
Here you go:
How to add a WPF control library template to Visual C# Express 2008
https://dotupdate.wordpress.com/2007/12/05/how-to-add-a-wpf-control-library-template-to-visual-c-express-2008/
Yes, it works this way for VSE2013 too.
UPDATE 2: I'm not absolutely positive about this, but I think he missed one little piece. In his step #4 he says to delete Window1.xaml and App.xaml. Maybe this didn't apply with VSE 2008, but in VSE 2013 there is also the App.config file which I believe is extraneous for our purpose. So you can delete App.config as well. As I said, I'm not absolutely certain about this yet, but I noticed that file in the project when I added a WPF User Control Library project to my solution, and I deleted it, and the solution compiled okay.
Try running devenv with the /installvstemplates switch, from https://msdn.microsoft.com/en-us/library/vstudio/ms247116(v=vs.100).aspx
If this doesn't work, browse to C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ItemTemplatesCache\CSharp\WPF\1033\WPFUserControl (this could change dependent upon your installation directory), open the .vstemplate file in a text editor, and make sure the setting is set to true, then try running devenv with the switch again.
Hope it helps.

Mahapps slows down WPF application

Since I added Mahapps to my WPF application it slowed down dramatically: it takes 5 times longer than before to start up and while editing the XAML code, Visual Studio often waits for 10 seconds or more while I'm typing.
Is this normal or are there tweaks to speed it up?
I'm using C# 4.0 on Win7 64bit.
Have same issue when I included the Icons.xaml file. But I deleted all content from that file and just put only those Icons/content which I required/needed for the project. For now its working fine..
If your having problems with the XAML in the designer perhaps you can try reloading it:
Press Ctrl+Shift+Esc
Navigate to the Processes tab.
Kill XDesProc.exe
This will reset the Designer, if that don't work try rebuilding the solution.
If you are using NuGet package to install you could try uninstalling and installing again.
You could also look at your performence tab. You wil find it under Ctrl+Shift+Esc aswell.
Look at your memory and processor to see if its constantly peeking while you are running Visual Studio.

Oversized Windows CE forms in Visual Studio 2008

I'm developing a Windows CE CF3.5 application under Visual Studio 2008, everything went smooth until the designer started throwing a NullReferenceException. Restarted VS2008, rebooted Win7 and the exception disappeared but all the forms for the project I was working on and new projects that I tested have this aspect:
On the emulator it varies, it either appears really tiny in the upper left corner or it displays correctly:
Any ideas? I've googled for this to no success. Thanks in advance!
In the solution explorer, expand your form and open the Form.Designer.cs file.
Have a look and try altering the AutoScale and AutoScaleDimensions properties
Like every good programmer you use some kind of Source Control (VSS, SVN, Git, etc.).
So simply make a diff of your current not working version and your last working one and see what changed.

Categories