Exceptions Archive

C# adding reference error - Checking a C++ DLL is valid for a C# project

DLLs compatible with C# projects can either be managed or unmanaged. However, if they're unmanaged, they cannot be included in the project using the standard References->Add Reference->Browse->OK method, as only managed DLLs can be added in .net applications in this method. To add unmanaged DLLs you need to use a form of DLLImport, which I

C# WPF - text box is not editable?

In my current work in the c#/WPF environment, I've had a need to create a new pop-out window with a load of text boxes and labels programmatically depending on a previous input. However, when I ran the code, the text boxes were not selectable, editable or changeable in any way. They just sat there, visible,

C# GUI with WPF - Using Group boxes

A short UI development post today following some work I've completed on building a new GUI for a project at work. Hopefully this post gives a brief introduction to those wanting to also use group boxes to group content, and how to resolve the issue where using group boxes may give you the error "The

NodeJS - how to install Socket.IO

This week my focus at work has shifted slightly away from Grasshopper and back into the world of web development, server communications and associated tasks. For part of my work, I created some test files to play about with sockets in Javascript (the bigger picture is to use sockets to communicate between some C# code

How to fix the 'Common Language Runtime was unable to set the breakpoint' error in Visual Studio projects

When you have multiple projects which link together, it can be handy to have them open in Visual Studio to debug through or work on them. This is especially true if you're using libraries which contain common code across projects. That is the purpose of a DLL after all (or static library), to provide common

How to fix 'type load exception' when loading a Grasshopper component

As mentioned previously, I've been working in James' territory on a Grasshopper component as part of my research. The tool is now ready for testing and as such, I gave copied of the .gha file and background .dll file to a colleague to test on their machine. However, instead of loading the component, Grasshopper threw

C++ Error LNK2005 - item already defined in file.obj

Linker errors (LNK) can be a bit more difficult to solve than standard C errors if you don't know how to read the error output. This is added to by the fact that you can't double-click the error and be taken to the line causing the problem (if using Visual Studio anyway), so being able

C++ Error C2784 - Working with GUID keys in map data structures

Error C2784 is caused by problems with the compiler for using a key in map data structures. Map data structures are very useful in C++, their C# equivalent being the Dictionary structure. They allow you to store data to a key, which means when you come to need that data you can use the key,

C++ Error C2011 - What it is and how to fix it

Errors are never fun to deal with, especially late at night with no one around to bounce ideas off of. During the course of my programming adventures I encounter many errors in compilation and hopefully, by posting them and the solution for them I might help myself later, or others, in solving the problem. Error