The type or namespace name 'Form' could not be found (are you missing a using directive or an assembly reference?)
-
Ok, that fixed that... Now the errors are:
The type 'System.ComponentModel.IComponent' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The type 'System.ComponentModel.ISynchronizeInvoke' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The type 'System.ComponentModel.Component' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Only thing is I'm using Visual studio 2012 ultimate. I can't seem to find the assemblies in: Project > Add Reference > Framework Any ideas?
Did you create a Console application by mistake? This is all setup for you already if you pick the Windows Forms Application project type.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Member 12244972 wrote:
I can't seem to find the assemblies in:
The system assembly would already be in the references, if you created the project using VS. Are you mixing .NET framework versions? What .NET version is the DLL targetting that you created?
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
Ok, I understand your point. The dll was targetting .net v2.0 and the program .net v4.6.1 I rebuilt the dll targetting .net v4.6.1 Still the same issue after restarting the Visual studio.
The type 'System.ComponentModel.IComponent' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The type 'System.ComponentModel.ISynchronizeInvoke' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The type 'System.ComponentModel.Component' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Any ideas?
-
Ok, I understand your point. The dll was targetting .net v2.0 and the program .net v4.6.1 I rebuilt the dll targetting .net v4.6.1 Still the same issue after restarting the Visual studio.
The type 'System.ComponentModel.IComponent' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The type 'System.ComponentModel.ISynchronizeInvoke' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The type 'System.ComponentModel.Component' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Any ideas?
Member 12244972 wrote:
The dll was targetting .net v2.0 and the program .net v4.6.1
Should work, might have problems if it was the other way around. Only thing I can think of, is that you might be targetting the wrong CPU-type; if the DLL is compiled for 64 bits, and the app is targetting 32 bits, or the other way around.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
Ok, I understand your point. The dll was targetting .net v2.0 and the program .net v4.6.1 I rebuilt the dll targetting .net v4.6.1 Still the same issue after restarting the Visual studio.
The type 'System.ComponentModel.IComponent' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The type 'System.ComponentModel.ISynchronizeInvoke' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
The type 'System.ComponentModel.Component' is defined in an assembly that is not referenced. You must add a reference to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
Any ideas?
Open up the csproj file in a text editor and look for this line:
<Reference Include="System" />
If the line isn't there, include it alongside your other references.
This space for rent
-
Did you create a Console application by mistake? This is all setup for you already if you pick the Windows Forms Application project type.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakOk, created a new project for Windows form. The recurring error now is:
Invalid token '(' in class, struct, or interface member declaration
In the code:
namespace Siren
{
static class Program
{
public partial class Form1 : Form
{
IDictionary _libs = new Dictionary();// yada yada yada... int absW, absX, absY, absZ; // Your inputs here Console.Write("\\nPlease input parameter 1 of first set... ");// Error occurs here... absW = Console.ReadLine(); }
}
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
} -
Ok, created a new project for Windows form. The recurring error now is:
Invalid token '(' in class, struct, or interface member declaration
In the code:
namespace Siren
{
static class Program
{
public partial class Form1 : Form
{
IDictionary _libs = new Dictionary();// yada yada yada... int absW, absX, absY, absZ; // Your inputs here Console.Write("\\nPlease input parameter 1 of first set... ");// Error occurs here... absW = Console.ReadLine(); }
}
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}The Console doesn't exist in a Windows Forms app. Also, this looks like you're putting Console code into a Windows Forms project now, where before you where trying to use Windows Forms code in something other than a Windows Forms project. So, which is it supposed to be? What are you really doing?
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
The Console doesn't exist in a Windows Forms app. Also, this looks like you're putting Console code into a Windows Forms project now, where before you where trying to use Windows Forms code in something other than a Windows Forms project. So, which is it supposed to be? What are you really doing?
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakI'm being impatient because I expected to be done with this today. But since that is not going to happen, I'll stop cobbling things together and recode with fresh eyes tomorrow. Thanks for the help. Will get back to you.
-
The Console doesn't exist in a Windows Forms app. Also, this looks like you're putting Console code into a Windows Forms project now, where before you where trying to use Windows Forms code in something other than a Windows Forms project. So, which is it supposed to be? What are you really doing?
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave KreskowiakDave Kreskowiak wrote:
The Console doesn't exist in a Windows Forms app.
Ehr.. stdout still exists in a WinForm. It is just a console-app that hides its console and puts up a GUI.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
-
Dave Kreskowiak wrote:
The Console doesn't exist in a Windows Forms app.
Ehr.. stdout still exists in a WinForm. It is just a console-app that hides its console and puts up a GUI.
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)
Yes, it does but the the purpose of this guys apparent homework, no it doesn't.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Yes, it does but the the purpose of this guys apparent homework, no it doesn't.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak -
Whoops. My bad. I got this one confused with another thread.
A guide to posting questions on CodeProject
Click this: Asking questions is a skill. Seriously, do it.
Dave Kreskowiak