WPF no "View Designer" context menu[visual studio] - wpf

Visual Studio 2022 17.1.1
In the previous version, right-clicking in the xx.XAML.cs file could see the menu "View Designer",
But now sometimes I can't find it

This is an issue with Visual Studio 2022. See here:
https://developercommunity.visualstudio.com/t/Designer-Cannot-Open-file/1505106?space=8&q=The+Designer+could+not+be+shown+for+this+file+because+none+of+the+classes+within+it+can+be+designed
Also refer to the final reactions after the feedback bot closed the issue - there are some added things that people are advised to check that might be causing this.
P.S There are still people reporting issues with the designer: https://developercommunity.visualstudio.com/t/VS-2022-WPF-designer-crashes/1688185?space=8&q=%5BVisual+Studio+2022+version+17.1%5D+designer&stateGroup=active&ftype=problem&sort=votes

Related

XAML Edit & Continue in Visual Studio 2015 (Update 2) does not seem to work

I cannot get XAML Edit & Continue (WPF) working.
I have Visual Studio 2015 Update 2, so it should work as mentioned here:
https://blogs.msdn.microsoft.com/visualstudio/2016/04/06/ui-development-made-easier-with-xaml-edit-continue/
However, after any change in XAML source (font size, colors, directly or in resource,...), change is not applied real time.
I am on Windows 7, latest .NET Framework. I must be missing something.
OK, I found this in a comment from Dante Gagne (Program Manager # Microsoft) from the link in your question.
I have VS2015 Professional Update 2 and was wondering what was going on.
I apologize for the confusion. Edit & Continue is ONLY available in the Visual Studio “15” Preview. The feature is one that we’re still working on, but we didn’t feel was ready for the “RTM” branch yet. That means that Edit & Continue will not work in Visual Studio 2015.
Additionally, if you are working with a Universal Windows Platform
project (UWP), you need to be using the Windows Insider build 14295 or
later along with the Windows Insider SDK build 14295 or later.
If you’re meeting this criteria and still can’t get it to work, PLEASE
get in touch with me and I’ll see if I can help.
His contact details are in the link from your question.
Posted again here
Update 6/23/2016
Visual Studio 2015 is going to have an Update 3 after all. However, As of the current RC, I do not see any plans for xaml edit and continue. See Visual Studio 2015 Update 3 RC
Update 8/12/2016
As Legends mentioned in his comment VS2015 Update 3 does NOT have XAML Edit and Continue. Looks like we're going to have to wait until VS "15" is released. I'll update again if I see Microsoft put a release date out.
Update 5/10/2017
VS2017 is out and I believe that is the version where this is supported. Probably no more updates from here on out.
Another couple reasons :
You may be in a Release build. It will let you edit but won't apply changes due to optimizations.
Your installation may be corrupt. If you don't see XAML listed under Text Editors - that could be the sign of an incomplete install.
See VS2017 RC1 Installation installation error - Microsoft.PortableLibrary.TargetingPack.Msi failed - No XAML
for more details on how I fixed a corrupt install.
Make sure you're not just being stupid and accidentally reopening the old VS2015 after a crash too :-) They look very similar.

Intellisense not working in Visual Studio 2013 for XAML

Recently installed VS 2013 Update 2. I am developing a WPF application and the first thing I have stumbled upon was absence of intellisense. I tried reinstalling, repairing, and any other suggestions found on stackoverflow. Resetting settings, enablig show members in options for text editor did not work.
After a day of frustration I found out that my greed to save space on HDD was the issue - I have unchecked Blend install during setup.
Solution:
Install blend (you can add it as a feature to an existing instalation of VS through same setup)
And after I installed blend, XAML intellisense started working as expected. Hope this saves some time for someone.

"The name 'InitializeComponent' does not exist in the current context" - for new WPF projects

I have a similar problem as previously reported (and unanswered successfully/unsolved) as below:
"If I create a new project in Visual Studio 2010 SP1 and select "WPF Application" it generates the application, but I get the error "The name 'InitializeComponent' does not exist in the current context" even before i build it.
I get the same error when I try to build established projects. Yesterday, I had no problems with it.
"
Im pretty sure that this issue is nothing to do with the project, source files or generated settings, but may have to do with a corrupt visual studio installation, registry, .net or windows itself because the same project (exactly the same) builds fine on my coleagues computer and vice-versa does not. Also, i have reinstalled Visual Studio, uninstalled & reinstalled, deleted & reinstalled, install-fixed from the microsoft disks and even tried manually deleting Visual studio/.net/C# and still get the problem. This issue is with both new WPF projects created with the wizard and with existing projects created weeks earlier.
The only option that seems to present itself now seems to be wiping my hard drive and reinstalling windows and Visual Studio again etc.
Any ideas regarding the fault or how best to wipe my system down to a level that will truly eradicate Visual Studio and its registry setting would be gratefully received ?
I had the same problem and eventually discovered (after reinstalling VS and that had no effect) that by removing and re-installing the .Net frameworks the problem went away.
There are two primary causes of this very common and annoying problem!
The most common is the x:Class doesn't match up with the MainPage.xaml namespace. Make sure that x:Class in MainPage.xaml has the correct namespace.
The second most common cause of this problem is that the "Build Action" is not set to "Page" for MainPage.xaml!
This happens with Silverlight or WPF and though it is a PITA when you don't know what caused it once you know what the problem is; it is a simple fix. One of those things we all have to learn the hard way, but thanks for Stack Overflow.
I wrote a blog article that has pictures and explains Initialize Component does not exist in current context problem.

Can't start debugger in VS2012 RC

Configuration:
Windows 7, 64 bit
Microsoft Visual Studio Professional 2012 RC Version 11.0.50522.1
RCREL
Running VS in administrator mode
The VS solution contains a web
application, with target: .NET Framework 4.
When I press F5, the solution builds... and nothing else happens.
Happens with both IIS or the VS Dev Server.
Happens with Platform Target of "Any CPU" or "x86"
If instead, I use the Debug / Attach to Process... menu, after a few seconds, I get:
"Debugger is Busy" - Debugger is performing a remote operation that is taking longer than expected. This dialog stay until I click "Terminate" and confirm it.
Then this dialog appears:
"Microsoft Visual Studio"
"Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named [COMPUTER NAME]. The network connection to the Visual Studio Remote Debugger has been closed."
After clicking OK, the 'normal' "Attach to Process" window finally shows up. In it, the list of "Available Processes" is empty.
Any suggestions or clues?
The main points that I wonder about:
Why is the list of processes empty? It is not surprising that the debugger does not work if it cannot see any processes.
Why is it trying to do "remote" debugging, when it is just accessing the local computer?
(Cross posted on social.msdn)
I had the same problem in VS 2012 (not the RC, but the final release) using a VS 2010 project. It would build fine, but the debugger would not start. So, I modified the solution file:
Changed "Format Verion 11.00" to "Format Verion 12.00"
And changed "# Visual Studio 2010" to "# Visual Studio 2012"
It's a workaround for now until my company upgrades its projects to VS 2012.
I've got a similar setup and I'd followed all the suggestions here and on Microsoft Connect - none of which worked for me. The only thing that did work was renaming MSVSMON.EXE in the x64 folder to MSVSMON.EXE.OLD and copying in the file from the x86 folder in it's place. I'm not sure if there are any other implications in doing this but it seems to have solved the problem in my case.
I eventually resolved this problem by deleting the msvsmon*.* entries in the \Windows\Prefetch folder. After doing so I could debug normally.
Ultimately, a Repair of the VS2012 resolved this issue for me. I followed the advice found at your social.msdn cross-post without any resolution (Devenv.exe /SafeMode /ResetSettings /ResetSkipPkgs and /Setup). Like you, my solution (VS 2010 SP1) also has a web application (targeting .NET 3.5), and the startup project is set to a winforms app. The ASP.NET development server did not start, nor did the app I was trying to debug.
Note that this issue was also posted to Connect at this link (by you?). If anyone else sees this issue, the Connect folks are requesting running the Microsoft Visual Studio 2012 Feedback Tool to collect data. As I started the Repair process prior to finding the Connect issue, I did not and was not able to provide feedback to MS with logging.
Seen a similar issue when running both Visual Studio 2010 and Visual Studio 2012 at the same time. Closing Visual Studio 2010 allow the debugger to start working in Visual Studio 2012.
I had the same issue - starting debugger just told me what a good job it had made of the build and the decided that that was enough.
I feared the worst, but luckily for me a reboot fixed the problem.
I know that this is therefore a pretty useless post in as far as offering help to anyone suffering with this issue, but I thought it was worth noting the point as it shows a) another person with the same problem so please fix it MS, and b) that sometimes a reboot fixes it so maybe that tells the maintainers something.
If you are opening a VS 2010 project with the new VS 2012 version it's probably your bin and obj folders that are causing the problem,deleting them solved the problem for me.Or you could clean your solution but I preferred manual deletion.
I just closed and reopened VS. This seemed to fix my problem
On another computer, with the RTM of Visual Studio 2012, I opened an older project and found that I could not press F5 to start the application. All that seemed to happen was a message in the status bar on the bottom edge of the window: "This item does not support previewing".
This solution had two projects, and the correct one was bold in the Solution Explorer, presumably indicating that it was the startup project.
However, after selecting the project and choosing "Set as Startup Project" in the context menu, I was then able to use F5 to run and debug it.
It turns out that the "This item does not support previewing" was nothing to do with the problem, but is a message that shows on the status bar whenever the item just selected in the Solution Explorer does does not support previewing.
For what it's worth, I found that I received this error message when I had an entry missing in my hosts file. I am using local domain aliases and the one I was trying to debug with wasn't in hosts. Adding the missing entry solved the problem for me.
Just copy all dte*.olb files, from C:\Program Files (X86)\Common
Files\Microsoft Shared\MSEnv to C:\Program Files X86\Microsoft Visual
Studio 9.0\Common7\IDE.
From https://mycodepad.wordpress.com/2013/12/07/visual-studio-2012-4-run-as-administrator-the-application-cannot-start-error/
Just my two cents,
I have experienced this issue twice now and it turns out after all of the suggestions I tried, it was BitDefender on my local machine that was doing this. So my fix for this problem is to try adding in exceptions to the local security software into the firewall and AV parts of it. Tell it to ignore the msvsmon.exe and devenv.exe altogether and see what difference that makes.
Otherwise try ripping it off altogether and see if the it lets you debug your solution.
You can see here for more info: http://forum.bitdefender.com/index.php?showtopic=37028
I installed the latest BitDefender version and all was fine for me.
I personally encountered some comparable problem: Visual Studio 2010 did not begin debugging but froze.
When I clicked VS it displayed a "Wait some more" or "Switch to" message box which didn't help me.
Using a task manager I could kill the *.vshost.exe process which brought VS back to life but aborted the debugging. Launching the program without debugging started the application instantly.
Solution:
Disable the indexing service for your code directories! Either deactivate the index service or uncheck the folders in the Indexing Service control panel.
Had this problem for a C++ application. Looking at the devenv.exe events in ProcMon pointed me to it trying to load a Visual Assist configuration file, which I had in my disk cleanup zeal accidentally deleted. Removing and then installing the extension again fixed it for me.
I have fixed the same issue by checking off the "Enable the Visual Studio hosting process" option from the start-up project Properties->Debug - Enable Debuggers options
All you have to do to fix this is go "Project > Set as StartUp Project" then hit F5 or the debug button and it will work!!!

Editing a Form in Visual Studio when TFS is offline

I'm running Visual Studio 2010 and using Team Foundation Server, and this thing is pissing me off no end.
Here's the scenario: since I work from home it often happens to me to work at strange hours or on the week-end, when our TFS is offline. This has never been a problem, since usually I just reload the solution and when VS detects that the TFS is not available it promprts you to work offline.
Now, I usually work on WPF projects, and working offline has never be a problem, even when editing XAML files it works with no issues. But now I have to edit a Form from a Windows Forms project, and VS refuses to collaborate. Whatever I do to the form, VS just does nothing other than playing that obnoxious "bing" sound that usually plays when an error of some kind occours. It doesn't even popup an error dialog box, just does nothing!
Any ideas??
Ok figured it out, I had to remove the "Read Only" attribute from ALL the files in the project (I had tried with the project file and form file, but that isn't enough evidently).

Resources