|
Different assemblies! oh i compiled my code to a .DLL library. I'll load that assembly and run during runtime. However, inside the project I have forgotten to add that .DLL. Is that what is causing the problem? how do i add in the assembly to my project?
|
|
|
|
|
[A]System.Collections.Generic.List`1[AutomatedTestDriver.Game] cannot be cast to [B]System.Collections.Generic.List`1[AutomatedTestDriver.Game]. Type A originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'. Type B originates from 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadNeither' at location 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll'.
This is the exception it throws me
|
|
|
|
|
Create a simple example and perhaps I can assist you further. I've never tried it, but I'm pretty sure you are supposed to load the DLL using Reflection, and then you are supposed to get the type from that loaded assembly. But I'd need to see some simplified example of what you are doing to know for sure what's going on.
|
|
|
|
|
Hi guys,
I have question about a code-behind in C# for an ASPX file.
the thing is that I made a class and I want this class to inherit from System.Web.UI.Page.
but it seems that this refrence does not exist.the only thing that exists is System.Web!!!!
so if anybody could help me I'll appreciate it.
thanks
|
|
|
|
|
|
Hello guys,
I would like to introduce an option where my application would allow a user to use the program either with the default settings or it would allow certain customizations.
The application would allow to tweak certain parameters via controls (check boxes, radio buttons etc). What would be the best way to save them, so in future, if the application would be re-executed, that saved settings file would be initialized and appropriate actions would follow? Should I use serialization? Are there some better ideas?
Thanks.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Use Application Settings[^] You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Thank you.
There is one issue I cannot understand.
When I tick/untick my checkbox control (causing .Checked to change), I close the window, resulting in saving my settings. Nevertheless, the config file does not get updated. The file always contains the default value of a control I had selected from the beginning, however, the application "remembers" the settings fine. So, if I were top re-execute it, the checkboxes would be appropriately checked. How come?
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Best guess is that you are looking at the wrong <appname>.exe.config file - there will be one created for your release and debug versions. Have a look at the modification dates and see if they change.
Difficult to tell from a vague description of the problem!You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
Yes, I have looked at the modification dates of both versions. Even if I copy my executable file to another folder - nothing changes in the config file.
My settings:
public bool setLOW_Inter2D {
get {
return ((bool)(this["setLOW_Inter2D"]));
}
set {
this["setLOW_Inter2D"] = value;
}
}
Saving them if the window is closed:
private void LogOptionWindow_FormClosing(object sender, FormClosingEventArgs e)
{
Settings1.Default.Save();
}
Integration of the settings:
this.cboxLOW_inter2D.AutoSize = true;
this.cboxLOW_inter2D.Checked = Settings1.Default.setLOW_Inter2D;
this.cboxLOW_inter2D.DataBindings.Add(new System.Windows.Forms.Binding("Checked", Settings1.Default, "setLOW_Inter2D"));
this.cboxLOW_inter2D.Location = new System.Drawing.Point(175, 141);
this.cboxLOW_inter2D.Name = "cboxLOW_inter2D";
this.cboxLOW_inter2D.Size = new System.Drawing.Size(115, 17);
this.cboxLOW_inter2D.TabIndex = 14;
this.cboxLOW_inter2D.Text = "Interactive 2D Grid";
this.cboxLOW_inter2D.UseVisualStyleBackColor = true;
Config file:
<setting name="setLOW_Inter2D" serializeAs="String">
<value>True</value>
</setting>
modified 1-Aug-19 21:02pm.
|
|
|
|
|
I found that my current settings modifications get stored in the user.config file that is located in
%INSTALLROOT%\Users\<user>\AppData\Local\Microsoft\ . Is there a way to save the files in the folder where my executable is?
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Hi All,
I want to develop COM dll in C# application.
Can anyone help me?
Regards,
sunil G.
|
|
|
|
|
Since .NET effectively supersedes COM, I am not sure that you can: You can go the other way via COM Interop, but I do not believe that C# can create a COM DLL. C++ can, but that probably isn't a lot of help to you... You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
How to create COM Interop in C#?
|
|
|
|
|
Google "COM interop c#" and you will get lots of hits. I know MS do a tutorial which should at least give you the basics. You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace
C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy
|
|
|
|
|
If you have a look in the AssemblyInfo.cs file for the c# DLL there is the following entry, which you can set to true.
[assembly: ComVisible(false)]
|
|
|
|
|
i make program send and receive information between two computers with TCP connection and the IPs are 123.0.0.1 and 123.0.0.2
now i want to apply it over the internet
(what IPs should i use to apply it)
(note: i dont have a static IPs but for every connection i know the IPs)
|
|
|
|
|
sanforjackass wrote: i make program
Is this program a desktop application?
sanforjackass wrote: IPs are 123.0.0.1 and 123.0.0.2
It doesn't matter even if you used 10.0.0.0 and 10.0.0.1, provided they are computer IP addresses.
sanforjackass wrote: now i want to apply it over the internet
Pay a visit here. Franly i think it is your best bet:
http://www.asp.net/[^]
sanforjackass wrote: what IPs should i use to apply it
Computer IP's
sanforjackass wrote: note: i dont have a static IPs but for every connection i know the IPs
You don't need to know this information to program for the internet. This guys:
http://www.codeproject.com/[^]
probably don't know your IP address for you to access their site.Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
He is clearly not making a website.
|
|
|
|
|
How do you know? Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
He said so in his previous posts, and he's still asking about the same subject just phrased slightly differently, IMO it's entirely reasonable to assume that he's still trying to do the same thing
|
|
|
|
|
Okay. Sorry for my wrong answer sanforjackass. Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
no it is my problem for not making the first Q. more clear but as he said i want to make my program works over nonstatic IPs over the internet
|
|
|
|
|
No sweat. Is it that you do not know the clients IP in advance? Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
If you know the IP addresses, as you have stated, then it is a matter of opening a TCP connection between them. Plenty of documentation for that.
I know the language. I've read a book. - _Madmatt
modified on Saturday, February 20, 2010 11:05 AM
|
|
|
|