visual studio 2010 ultimate designer error - visual-studio-2010

I have installed Visual studio 2010 ultimate and when I try to open any window form from my existing window application project it gives me designer error as "The designer could not be shown for this file because none of the classes within it can be designed."
here is the image
Call Stack error message image
it works fine if I create new window application project, but giving problem for existing projects. Please help

Your question gives us very little to go on, considering you don't show us even a sample of the code that the designer is choking on.
My crystal ball tells me that you've created some custom control classes that inherit from other classes in your project. When the designer goes to load that custom control class, it tries to instantiate its base class, and so on up the inheritance hierarchy. If it doesn't find one of those base classes, it errors.
The solution is simple: make sure that you've built the application/library first, before trying to open any of its custom controls in the designer. That way, all of the dependencies exist and are available to the designer.
Another possible problem, along the same lines, is that your custom controls are using some functionality only available in the full version of the .NET Framework, but your project is set to target the Client Profile. To fix this, open your project's Properties window and change ".NET Framework 4.0 (Client Profile)" to ".NET Framework 4.0".
If none of that fixes the problem, the last glimmer I can see in my crystal ball is based off the name of the code file that you've shown us in the screenshot: ExtraServices.cs. That doesn't sound to me like the name of a control. It sounds like that's just a regular old class. If that's the case, you can't design it because there is nothing for the designer to display. The only code files that can be opened in the designer are those that inherit from System.Windows.Forms.Control or one of its derived classes (e.g. System.Windows.Forms.Form). Just right-click on it and open it as a regular code file.

Related

exporting data in excel using listview vb 6.0

I'm new to vb 6.0 this is an existing project.
Suddenly the hardisk was corrupt so i take backup form sever and run in new hard disk and when the project run there is no issue but when ctrl+F5 (compile) OR build exe get this error given below.
Is there any reference missing or need to add
You need to add a component Microsoft Windows Common Controls 6.0 (SP6).
Go to Projects -> Components (Ctrl+ T) and check the checkbox for it.
Once this is added, you will also see extra components in the available GUI elements.
Regarding the screenshot it looks like you have referenced both OCX Libraries
Microsoft Windows Common Controls 5.0 (SP2) - comctl32.ocx
Microsoft Windows Common Controls 6.0 (SP6) - mscomctl.ocx
You can only use the ListSubItems collection with the Common Controls 6.0. If you want't to check which one is in use, you can open the .frm file in a TextEditor and search for the control name.
In front of the name you see either ComctlLib.ListView (5.0) or MSComctlLib.ListView (6.0)
You can also try to change the Library in the TextEditor. It worked with a sample project for me, but I'm not sure if there are properties used in your project that could break after the "switch" to the 6.0 controls.

Visual Studio 2010 - Add Reference Tabs will only give me projects. No Browse Allowed?

My problem seems pretty simple. I have a Solution with multiple projects and basically I am trying to do some mixing with C++, C# and CLI. My problem is that I need to add references from my c++ project. When the "Add Reference" dialog comes up, I only get tab for "Projects".
I know that usually you get multiple tabs for adding different reference types. What I am interested in is the "Browse" dialog. I need this to add a reference to a dll that is prebuilt. I am targeting .Net 4.0.
It seems like there is a project property that can be set to limit this but I'm not sure. MSDN seems to mention something along the lines that if you have multiple projects in a solution and they target different versions of the .Net framework, the list of possibilities may be limited.
In "How to: Add or Remove References in Visual Studio" MSDN mentions: "The number of tabs available at the top of the Add Reference dialog box can vary, depending on the type of project open and the resources it is using. C++ native projects contain only a Projects tab."
It doesn't really mention what these are specifically so maybe its just a broad subject. Anyways, I have stripped down the solution to only my C++ project and I can build successfully. However, I can only add References to other projects.
Apparently, setting the CLR option on the project is what opens up the list to include more options. I only wanted to enable it on one source file, but I guess Visual Studio will not add reference capabilities unless you turn it on for the whole project.
Therefore, my solution was to enable it for the whole project, add the reference, and then remove the option on the project. Basically a dirty trick but just in case people run into the same issue, that is what worked for me.
Erik

Unable to load dsr files in vb6 project

I am currently trying to open up an old project that I have in my possession. Its written in vb6 and I have attempted to upgrade to a newer version but I get a slew of errors saying I need to have a working vb6 environment with all references in order to upgrade.
I have vb6 itself working and when I open my project file any .dsr, .dsx files will not load with the following error (which prompts me to go to the log file).
Line 2: Class {BD4B4E61-F7B8-11D0-964D-00A0C9273C2A} of control crBooking was not a loaded control class.
Line 0: The file C:\Users\Greg\Desktop\VB6 - Conversion\VBSource\crBooking2.Dsr could not be loaded.
All form files along with class modules and the project file itself load just fine. I have no idea what this means or how to fix it. Any help would be greatly appreciated.
The .dsr files are generated by any so called Designer. Those are extensions which can be added to the VB6 environment.
On example is the Designer which is used by the Visual Basic for Applications IDE extension. This one is used, if you are developing an extension for VB6 or VBA itself.
As already mentioned, the GUID seems to belong to a Crystal Reports component. So it might be necessary to either install a greater version of VB6 (some of them come with a Crystal Reports light) or to install the Crystal Reports software itself.

Converting from console to windows app in visual studio

When changing the project from console to windows app, I still am not able to use the namespace System.Windows.Forms. Do I really need to create a whole new project? If there is a better way, please give a detailed description of how to do this in visual studio step by step, thanks :)
The Console Application project template that you started with does not have the necessary assembly references. Project + Add Reference and select System.Drawing and System.Windows.Forms.
Also be sure to make the necessary changes in the Program class. Main() must have the [STAThread] attribute and you need to add the boilerplate code to enable visual styles and start the message loop. Take a look at a sample Windows Forms project to get that right.
You can use Windows.Forms independent of the the type of project. All you need is a reference to it. In your solution explorer you will find a folder "References" just under your project folder.
Right-click and choose "Add Reference". Scroll through the list and add System.Windows.Forms (and probably System.Drawing).

VS 2008 designer "Could not find type...."

I'm getting this error in visual studio 2008 in a Mobile Desktop application .NET 3.5.
Could not find type 'MyNamespace.MyType'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built.
This shows up when opening a form. The type that it can't reference is a user control that is part of the same project. Nothing is wrong with the namespaces. This is maddening -- the project builds just fine.
Also, the referenced control is not a generic class like in this article: "Could not find type" error loading a form in the Windows Forms Designer
UPDATE: well now later it seems to be working. This seems to be a sporadic problem...
Is the actual line that is causing a problem in the Form.designer.cs/vb file? Occasionally there are name qualification issues that result in the error you are seeing. Try opening up the designer file and changing the name as follows
C#
global::MyNamespace.MyType
VB.Net
Global.MyNamespace.MyType
After that, rebuild and reopen the designer

Resources