IDE Support for WinForms - c#

Hey guys I'm a newbie and I just wanted to know of the people who do Winforms on Visual studio, at your place of work do your forms have IDE support. Because for some reason I don't have IDE support on 99% of the windows forms I'm working with. I mean I can not see anything on the design view except for errors is this the usual case in industry????

Are you using any 3rd party UI controls? Some have dll's for the design view to work, and if you haven't installed the toolkit on your developer machine you might get errors like this.

One possible explanation for having errors on forms is licensing. If your company uses third-party controls on their forms, they could cause errors when trying to display the forms on unlicensed machines.
Another possible explanation for errors with third-party controls is simply installation. If you don't have the controls installed and referenced properly, that could also cause errors.
You could try to post some of the errors you have to another Stack Overflow question, and perhaps the community could help you solve your errors.

Sorry, WinForms is not broken for us (me). Check your code. Sometimes WinForms applications that were developed under Visual Sudio 2003 (or earlier) when upgraded to Visual Studio 2005 (or later) become unstable.
Start with a new form, and if the IDE (it is called a visual designer) works fine, then think about re-creating the old forms from scratch with the newest VS installation.

Your question isn't clear!, if the Visual Studio Designer not working well then re-install the IDE
Or explain more...

You should be able to view the forms in the design view.
Always unless there is an error in code. In case the project is building you should get the same error (this is a runtime error) that you will generally get when you run the code.
In case the project is not building it will be simpler to fix the errors :)

Related

Visual Studio 2022 Web forms designer page problem

I am new to Visual Studio 2022 web forms. Recently before the update, I can drag and drop elements with ease in the design area. Now with the new update , I just can't simply do it. Can someone share their experience on how they fix this one? Big thanks
I been using vs2022 with webforms - no issues.
Since I have previous vs versions installed, it seems my settings might perhaps "stick" better, but check this setting:
tools->options
Then expand Web Forms Designer, and on general, choose this:
So, setting above to use Legacy Web Forms designer should fix this.
The live preview is actually a BIG new feature in vs2022 for web forms, but regardless, try above.

VS2015 unmanaged debugging

The shop where I work is currently using VB6 for development using controls and libraries. Someone once showed me how to use Visual Studio to be able to debug this code by simply creating a console application in C# and then changing a few options. He showed me this in VS2010, but I am now using 2015. When I go into the project properties and go to the Debug tab, the option for "Enable unmanaged debugging" is not there. Did Microsoft remove this option? I have searched the web quite a bit, but have had no luck finding a solution.
Also, for kicks, I also have 2010 installed on my machine. The option is available there, however when I attempt to run and debug I get a LoaderLock failure. After researching it I found that I have to disable the exception in Visual Studio. However, it would appear that my exceptions are locked down and I cannot change them as they are all greyed out. I am an administrator on the machine I am using, but I am unsure of where or what I need to change to enable me to change the exception settings.
Any recommendations on either issue would be greatly appreciated. It's not a show stopper for me, but a HUGE inconvenience.

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.

winform to GTK# for Mono

I have created a C# application with 50 forms.
Unfortunately Mono (Mac OS version) doesn't work with standard window winform.
I don't know why, but I this moment I need to solve the problem.
The only solution seem convert winform to GTK#, but I don't have any experience on GTK#.
My questions are:
How hard is convert my 50 forms to GTK# ?
What I need to do exactly ?
This is an easy solution ? Or I need to re-write my application ?
Apart this I don't know where I can found/use an Visual IDE to do a design modification like Visual Studio IDE.
GTK is a pretty good framework, on both windows and linux, GTK# is very easy to write by hand or to design using monodevelop. So it is worth a shot if you are curious, GTK# apps are generally easier to find help for ( the GTK+ docs are helpful )
The nicest thing about GTK# is the automatic layouts, no more crazy panel placement or absolute positioning like in winforms.
I am curious though why your winforms app isn't working, Mono's winforms support is pretty good and very near exactly matching .Net. What errors do you have?
The issue I had with Winforms at Mono was that in the files "xyz.designer.cs" there is often a code:
((System.ComponentModel.ISupportInitialize)(xyz)).BeginInit();
and
((System.ComponentModel.ISupportInitialize)(xyz)).EndInit();
looks like Mono does not accept this code.
My impression is that this code could be deleted from most of the windows forms. But I am not really sure.
For sure the "xyz.designer.cs" file cannot be modified under Visual studio since this code is automatically created by the GUI designer.
But you could modify these files under Monodevelop.
Looks like you would need to manually update 50 files.

Should or can Visual Studio run inside App-V and what are the repurcussions?

There is a debate going in our department to virtualize Visual Studio into App-V, Microsofts Application Virtualization. In the back of my mind, I think doing this will cause problems when trying to debug or run other tasks in Visual Studio but I can't put my finger on any one thing to support my argument.
Has anyone had any experience with Visual Studio 2010 running inside App-V?
I am open to the idea if there are no issues but I am afraid that if this is put in place, we will have issues.
What do you think?
Based on the description of App-V here I'd be shocked if the performance was good enough for Visual Studio to be usable. VS is a very processor and IO intensive application. Virtualizing its entire operation over the wire is likely drag performance down to unacceptable levels.
I have seen VS perform acceptably on local VMs running VirtualBox, that might be another option for you if platform standardization is your goal.
I know this is an ancient question, but I found it in a Google search. Just wanted to mention that we've been running Visual Studio 2010 this way for a couple of years, and it's fine. We use it in both a classroom setting and on developer desktops.

Categories