Refactoring Menu Not Showing in Visual Studio 2012 RC - c#

The refactoring menu isn't showing up for me in Visual Studio 2012 RC. It's not showing in the menu bar or in the context sensitive help. Is there a setting I need to change to make it appear. I see the refactor menu in the customize option but can't make it show up in the menu bar. This is in a c# project.

I had this happen to me just now. Turned out I was editing a file that wasn't part of the open solution -- it was from another branch. Confused the heck out of me until I realized that.

I had a similar instance. Turns out, the project I was working on doesn't always have some of the files set to compile. In this case, it was an ASMX file, and none of the refactor bits worked.

Related

Cannot Open Form [Design] View in Windows Desktop Form .NET Core Application

When I create a new Windows Desktop Form Application using .NET Core with the latest Visual Studio 2019 Community Edition update, I cannot view the design view of the form, i.e., Form1.cs[Design]. When I click on the appropriately labeled Form1.cs file, it only opens up the code view.
New Solution Open Form1.cs code view only
Edit: At the time the question was asked Microsoft hadn't released the visual designer for WinForms in .NET Core in Visual Studio 2019. It needed a separate preview install. By May 2020, Visual Studio version 16.6, the designer was still in preview but could be enabled from Tools/Options/Environment/Preview Features/'Use the preview Window Forms designer for .NET Core apps' without needing an install.
As of November 2020 the designer is still in preview, but is enabled by default in projects in Visual Studio 2019 version 16.8 and later. It's still not complete, particularly re data binding, but the number of issues is much smaller. It can now be disabled via the Tools/Options menu as discussed above.
Took me a while, but...
Apparently, according to this page, you can bring up form designer in the following mysterious steps:
In the Solution Explorer, look for the head toolbar,
Find the icon that looks like an empty HTML tag: <>
When you click it, it will disappear, which makes no sense, but then,
Your plus signs (tree expand buttons) on the left side of the files will be gone too - that's a good sign:
Now you can doubleclick on your Form1 (or whatever it's called),
And after a few seconds of thinking, it will open the Form Designer.
Why this?... I literally have zero idea. But it worked for me.
Maybe tomorrow I'll find out more about this and yes I promise to come back and update - until then, just follow this little yellow brick road. I hate the fact that in 2021 some of the modern tools require dark sorcery to operate on a basic level, but hey. We're in this together.
Good luck!
This thread is the first when requesting "c# visual studio 2019 cannot open designer", so the solution may be useful for those who have encountered an error when the WinForms constructor stopped opening in VS2019.
The screenshot shows the steps to DISPLAY the ERROR that caused WinForm to stop displaying
I found this trick worked for me:
Right click your project in Solution Explorer and select 'Unload Project' from the context menu (near the bottom).
Right click again and select 'Load Project'
Now when you double click on your form class, it opens in the design editor

Visual Studio 2015 XAML files freezing

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/

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.

Wrong behavior of the compiler in Visual Studio 2012 after opening project create in Visual Studio 2010

I read that there is no problem to use Visual Studio 2012 for projects written of Visual Studio 2010. I open my project in vs 2012 and start it, everything was working. I can make changes in the existing classes and pages, no problems occur. After that I decide to add new class and here nothing was working correctly:
References to the other classes, if I add DataSet and add using System.Data it is not shown like special word(in green)
No errors no warning about new classes shown by the compiler. If I write 12312312 and build no error is shown.
Errors are shown in the browser, but I strongly prefer to have a working compiler.
Do you know what is the problem and how to fix it ?
Cleaning and Rebuilding is the way to start.
For more detailed info, take a look at this post:
Visual Studio 2012 - Intellisense sometimes disappearing / broken
For the Compiler not showing errors, give this a shot:
Delete the files in this folder:
%AppData%\Roaming\Microsoft\VisualStudio\11.0\ReflectedSchemas
Pulled from Intellisense and error highlighting not working by default in VS2012

Blend for Visual Studio 2012 design view not working

I'm working on a Windows Store App in Visual Studio 2012 and decided it might be easier to start using blend for the interface and layout. But in my attempts to make this layout design easier for myself, I have run into a problem with the design view. The error message is that design view is unavailable for x64 and ARM platforms.
I'm familiar with this error from Visual Studio but I was just wondering if there's a simple way to change the target platforms so I can see the design view in Blend?
I know there have been problems with blend for VS 2012 up until now, but I thought maybe this was an easy one to fix that I'm missing somewhere.
If anyone knows a way to fix this I'd really appreciate it.
Thanks!
Close Blend
Open the project in Visual Studio 2012
Change Release/Debug Configuration to Any CPU or x86
Save All in Visual Studio to make sure it saves the project
(The Project does not save when you run!)
Reopen the document in Blend
That's it!
Just go to Build->Configuration Manager and change the Platform to 'Any CPU'.
Additionally you can enable the 'Solution Platform' dropdown in the toolbar by clicking the little down arrow right to the debugging Toolbar items then click 'Add remove buttons' and select 'Solution Platforms'.
Change .NetFramework from 4.5 to 4.0
You would need to install windows phone sdk for blend to work correctly in your application.
http://www.microsoft.com/en-us/download/details.aspx?id=35471

Categories