VS 2015 munging winforms on my devel laptop - winforms

VS 2015 (and 2013 for that matter) is badly mangling my WinForms in the Designer. It's resizing this form in particular and squishing everything down forcing me to remake the form repeatedly.
Seems to happen only when I compile on my laptop. Any settings I'm missing?

Related

Visual Studio 2019 blurry on remote server over remote desktop

I have a vm (Hyper-V) running Windows Server 2016, and on that instance I am running Visual Studio 2019 Pro. Everything in VS is a little bit blurry: the text editor, menus, solution explorer, everything.
Nothing else inside the vm instance is blurry: desktop perfect, Chrome browser/pages perfect, windows explorer perfect.
There is no Compatibility tab available on the devenv.exe for VS2019. I went down a rabbit hole trying to solve that, and eventually found a way via right-click, Troubleshoot Compatibility...and eventually that sort of worked, but it made all VS display in super tiny fonts, almost unreadable, but not blurry anymore. This was worse, so I put it back.
I have another vm that runs Win10 Pro instead of Windows Server 2016, and my VS2019 Pro on that instance is perfect, not blurry at all.
How can I solve this blurriness problem?
I feel your pain, I had the same issue and thought my eyesight was failing me. It sounds like you need to enable the new VS2019 DPI awareness feature.
But if that doesn't work, then perhaps it's time to see the optometrist ;)
Also whilst you're at it, I'd recommend setting these (somewhat related) parameters to make VS2019 a little snappier in the rendering department, e.g. scrolling the editor.

Visual Studio 2017 Many WPF objects missing from the toolbox

I just installed Visual Studio 2017 Enterprise and selected Desktop-Development for .net features.
Now when I'm starting up Visual Studio and create a new WPF project, theres no advanced objects in the toolbox like the arc Control or more Effects other than BlurEffect and DropShadowEffect. These and many others are just missing. When I look in the object browser in Visual Studio Blend, I can't find them there either.
Do I need to install something else explicitly?
Okay so I found it out: You have to manually select "Blend for Visual Studio SDK for .NET" in the Components section of the installer. This will actually install all the advanced WPF Controls, which where missing for me.
Those where always installed from VS Installer versions 2012, 2013 and 2015 automatically (its a package of 100mb).
I can just imagine that the Idea of a much more modular installer led the designers there to think "we need to make the installation faster so push out every little package that was used commonly throughout the last 5 years.".
And then they thought: "BUT hey, when it comes to the Xamarin installation, let's KEEP IN all the Google-Emulators for Android which pack a WHOPPING 17 GB!!!"
They surely thought also: "Most people wont need these, since they either have a android device on their own or they use one of our emulators, which are vtx enabled, so 10 times faster than googles emulators, and ours also only need 1 GB of disk-space. But well, we wanted to make a fast installer after all, so let it pack our customers drives full of stuff they don't need at all".
You can right-click on a category in the toolbox and click on the "Choose items" option and try to find the tools that you are missing:
visual studio 2010 toolbox standard controls missing
Blend is more design friendly than Visual Studio though so you shouldn't be suprised if you see more options in Blend. After all, Visual Studio is a programming/coding tool and Blend is a design tool.
You rarely (or never) use the toolbox to add elements to a WPF view in a "real-world scenario. In fact it is quote common to disable the designer altogether: http://blog.spinthemoose.com/2013/03/24/disable-the-xaml-designer-in-visual-studio/. If you are a serious WPF developer you should really learn XAML and MVVM :)

'Could not find part of a path' errors in Visual Studio 2013 that don't appear in Visual Studio 2010

I've recently had the misfortune of being upgraded to Visual Studio 2013 at work and it has been nothing short of a nightmare. Ever since upgrading my large scale WPF application to .NET 4.5.1 in Visual Studio 2013, I've been getting mysterious 'fake' errors appearing in the Error List. Sometimes they even stay after a Clean and/or Rebuild, but they not really true errors. Here is an example where you can see that I have just cleaned, but still the errors remain:
I want to be clear here... there is no problem with this view model and I can build that project, or the whole solution without (real) error and the application also runs perfectly:
Furthermore, when running the application there is also a problem that it has with image paths. My images are all displayed perfectly, but I get these 'fake' errors again:
Note that the listed paths are even displayed incorrectly:
C:\Midas;component\Images\Actions\Delete.ico
In the UI, it is referenced like this:
<Image Source="/Midas;component/Images/Actions/Delete.ico" ... />
I'm not really sure whether these fake errors are caused by changes made to Visual Studio 2013, or by changes made to the .NET Framework in versions 4.5, or 4.5.1. I'm hoping someone can shed some light on this for me, because I'm about ready to downgrade to .NET 4.5, just so I can use Visual Studio 2012 instead.
It looks like you're using the /{Assembly};{path/to/Image} construct without the pack:// uri prefix. The editor is warning you that it can't find the file because it doesn't really understand the Uri (until the application is actually built). It'll be defaulting to looking on the file system and trying to prefix it with file://, which of course results in a relative uri to the working directory of the Visual Studio process.
I suspect that if you explicitly include the pack:// uri prefix, that the editor will stop complaining.
pack://application:,,,/Midas;component/Images/Actions/Delete.ico
That way the designer will just know that it should not be trying to look for a file:// location.

Can Surface SDK run on Visual Studio 2012?

I need to create a WPF app using the Surface SDK. I am using Visual Studio 2012, and according to this SO post, VS2012 doesn't allow that. However, since this was posted before it was officially released, I want to make sure I'm not missing something.
I just need a few of the touch/swipe controls that come with it. Is there a different option for VS2012? The other developer is using 2010, so it needs to be able to still run on his machine. It's a very simple app that I just need to hammer out, so I'm looking for the fastest, easiest method. Both of us and the end application is to run on Windows 7.
I found an easy solution by which it seems to work. It does expect you to have Visual Studio 2010 installed. Following the following steps I managed to compile in Visual Studio 2012 using .NET 4.5. TouchDown events work. I tried it out on some small projects and they seem to work perfectly fine.
Use Visual Studio 2010 to set up a Surface project.
Safe and close Visual Studio 2010.
Open the solution using Visual Studio 2012.
Change the target framework under project settings to .NET 4.5.
Save as a new solution file.
Compile, ... everything works!
This method prevents you from having to set up all the configuration files/references yourself. The only downside is you don't have any of the Surface tools integrated into the IDE. E.g. the toolbox, project templates, ... This of course doesn't prevent you from writing plain XAML yourself.
If for some reason this doesn't work in the long run I will update this post.
The easiest way will unfortunately be for you to run VS2010.
Currently the SDK is not supported in VS2012, for a few reasons.
Notably, the way that touch works in Win8 is a lot better than in previous versions of Windows. This unfortunately meant a rewrite of the touch layer that the Surface SDK uses. The new controls are written to adapt dynamically based on mouse/touch input, making the Surface SDK controls a bit redundant.
Microsoft might make the SDK available for VS2012 in the future, but this is kind of debatable.
If you are still dead set on giving it a shot, download an application called Orca (http://msdn.microsoft.com/en-us/library/windows/desktop/aa370557(v=vs.85).aspx) and edit the SDK installer file, removing the dependency on VS2010.
This is how I got the Surface 1 SDK to work with VS2010, since it was targeting VS2008 (note that it still has not been updated to work with VS2010)
Let me know how you go.

Visual Studio 2010 errors on build of project with WPF DataGrid

I've moved a C# project from Visual Studios 2008 Professional to Visual Studios 2010 Express.
It converted the project successfully with the VS migration wizard, but the build is failing.
There are quite a few errors, all having to do with the WPF Datagrid. The errors don't occur when built in VS2008. For example:
'DataGridRow' is an ambiguous reference between 'System.Windows.Controls.DataGridRow' and 'Microsoft.Windows.Controls.DataGridRow'
I see that the project also uses WPFTools.dll.
With VS2010 maybe WPFTools.dll is no longer needed? Or maybe I need to use the Professional version instead of the Express version of VS and the project wasn't successfully migrated?
I think I can edit all the places where this is a problem using the full namespace to make the error go away, specifying either "Microsoft.Windows.Controls" or "System.Windows.Controls", but I'm not sure which of the two it was defaulting to under VS2008.
This is most likely tied to the .NET FW version, ie...was this 3.5 prior and you migrated to 4? If so, you would have been using the WPFToolkit prior whereas the DataGrid is now part of the standard FW in 4 and greater.
Remove your references to the WPFToolkit and use the standard FW class and you should be fine.

Resources