|
|
OK - So it looks like if I need to reference 3rd party dll's then the recommended practice is to put these dll's in the bin\Debug directory. Is this correct?
Since the name of the directory is "Debug", I wasn't sure about the implications of running the app in Release mode as opposed to Debug mode. Does this make a difference as far as the directory where the dll should be put?
|
|
|
|
|
Actually, the standard practice is to include them as a reference in the project. It handles them properly that way, so regardless of what build you're in..it places it into the proper folder.
1. Open your solution file.
2. Right click on the project file.
3. Select "Add Reference...".
4. Either select the third party dll's using the dialog (most likely the 'Browse' tab)
5. Build your project
6. Enjoy having Visual Studio handle the management of your third party dll's.
|
|
|
|
|
Of course - I know how to add a reference to a 3rd party dll.
The question is - where is the best place in my project to keep the physical dlls that I am adding a reference to?
|
|
|
|
|
I just put them in a folder called Include, but there may be a better way.
|
|
|
|
|
I think I've been on projects where there was a top-level "dlls" folder but I don't remember for sure.
I would imagine that Microsoft or FXCop has a best practice for this....
|
|
|
|
|
OK - The current project that I am working on has a top-level "ReferencedLibraries" directory under the solution with all of the 3rd part dlls. This seems like the way to go.
|
|
|
|
|
Yeah, that part is just completely arbitrary.
|
|
|
|
|
Hi,
Does any one know about any open source database library made in C# that contains implemnentation of select insert, update queries.
Thanks,
Mushq
|
|
|
|
|
Have you looked at SqlDataAdapter[^]? It's not open source, but it's included in the .NET framework.
If you're looking for something as a learning source, check out NHibernate.
Tech, life, family, faith: Give me a visit.
From my latest post: "It's sobering to watch: the whole country stops for 2 minutes as a siren is blast to remember the 22,437 victims of terror and soldiers who died in defense of Israel..."
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
What I want to do is create a table of sorts:
___________________
| |Key 1|Key 2|
|_____|_____|_____|
|Sub 1|Value|Value|
|_____|_____|_____|
|Sub 2|Value| |
|_____|_____|_____|
For example in the System.Collections.Generic.Dictionary class I can access values like so:
dictionary[key]
what I want to do is access the value like so:
table[key,sub]
Any ideas?
|
|
|
|
|
Use a multi-dimensional array[^].
Tech, life, family, faith: Give me a visit.
From my latest post: "It's sobering to watch: the whole country stops for 2 minutes as a siren is blast to remember the 22,437 victims of terror and soldiers who died in defense of Israel..."
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
I believe he's asking for a two-key dictionary.
|
|
|
|
|
In practice a multi-dimensional array would do the same thing...
<br />
int key1 = 0;<br />
int key2 = 1;<br />
<br />
string[,] table = new string[2,2];<br />
string x = table[key1,key2];<br />
|
|
|
|
|
That would work if the keys are ints. Andrew is correct, I'm looking for a two key dictionary.
|
|
|
|
|
Another possibility is a Collection of Collections. For example, a Dictionary of Keys whose values are another Dictionary of SubKey/Value pairs.
|
|
|
|
|
Yes I was considering that and that may be the best way to go. I don't want to use nested switches because that looks messy.
|
|
|
|
|
Switches?? What switches?? I didn't say anything about any switches.
|
|
|
|
|
Yeah, I'd just suggest nesting two generic dictionaries.
Dictionary<Keycode, Dictionary<Keycode, T>>
Something of that sort...
|
|
|
|
|
Jordanwb,
Will you always know the key and sub values?, or would there be cases where you would only have one value?
If you know both, it might not be the best solution, but you could do "key:sub" as the key for your dictionary.
Just an idea.
Regards,
Gareth.
|
|
|
|
|
The two key types are enums, so yes I would always know.
How does the "key:sub" work?
|
|
|
|
|
I use a Dictionary of Dictionaries.
There is also this[^] article.
Even simpler would be to shift one key "up" and add it to the other. k = a * 1000 + b
But, as I see you also mentioned enums, I'll also mention this[^] article. (If you like that idea, and my comments on it, let me know.)
|
|
|
|
|
Hi,
I have a realtime WindowsForms App updating business object from
a background thread (about 1000 objects). I would like to reflect
the changes in the UI.
I have had a look at INotifyPropertyChanged and BindingList but I am
getting Cross thread exceptions.
What is the best way to handle this?
- backgroundworker or
- new thread with Event wrapper using SynchronizationContext ?
Is it right to create a never ending Background worker (BGW 's
lifecycle = application's lifecycle in my case) and thus monopolize
one of the default 25 threadpool thread ?
Thanks in advance
|
|
|
|
|
reivilos wrote: What is the best way to handle this?
The UI thread should update the business objects. If the background thread needs to tell the UI to update the business object, use a SynchronizationContext and Post to it from the background thread. If you need to spawn a new thread yourself that lasts for the duration of your app, don't use a threadpool thread, create your own.
reivilos wrote: Is it right to create a never ending Background worker
Don't do that, it's not what the BackgroundWorker was designed for. Since it's using a threadpool thread, you certainly shouldn't do this. Create your own thread and make changes to the business objects by Posting to the UI thread's SynchronizationContext.
Tech, life, family, faith: Give me a visit.
From my latest post: "It's sobering to watch: the whole country stops for 2 minutes as a siren is blast to remember the 22,437 victims of terror and soldiers who died in defense of Israel..."
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
I am trying to use this DLL in Vista 64 bit version. It give me error (exception)
"BadImageFormatException was unhandled". The same DLL works fine with 32 bit version (Vista). Anyone has come across it, is there a way to resolve it?
|
|
|
|