Not finding a namespace

  • Thread starter Thread starter K Viltersten
  • Start date Start date
K

K Viltersten

I have a namespace Donkey in a project
called Donkey. In another project i
have created a WPF shell (exciting
stuff, by the way).

Now, i'd like to create an instance of
one of the classes in the Donkey as i
press a button. The code is like this.

private void Execute_Click
(object sender, RoutedEventArgs e) {
Monkey monkey = Monkey (); }

Monkey is a class in Donkey, of course.

Since the compiler doesn't know about
Monkey (nor Donkey) i added:

using Donkey;

but it just nags about references
missing and assemblies being incorrect.
So, i tried to add a reference to
Donkey in my WPF project but i don't
really see what to conenct to what.
Suggestions?
 
[...]
Even with your Donkey project correctly added as a reference to your shell
project, and even with a correct "using" directive at the beginning of the
file that includes this code, it won't compile because you've forgotten
the "new" keyword.


Besides that, of course. It's a typo.

What i've done is that i referenced an EXE file, which
in my (possibly ignorant) opinion is a strange thing to
do. Is it?
 
What i've done is that i referenced an EXE file, which
Yes, I'd say "strange". But I don't know that it's not allowed. There's
not much difference between a DLL and an EXE, other than the way the OS
loads them. I don't know that those differences would lead to some
compiler error.


I was unclear, i think. I _GOT_ it to work. No apparent
errors there. My problem is that i fear that i did
something seemingly working but going to bite me in
the lower back later on, since i didn't use DLL, only
EXE. So, if you can't see anything wrong with making
the program run _THAT_ way, we have no problem. :)

Thanks and sorry for not being clear.
 
I was unclear, i think. I _GOT_ it to work. No apparent
errors there. My problem is that i fear that i did
something seemingly working but going to bite me in
the lower back later on, since i didn't use DLL, only
EXE. So, if you can't see anything wrong with making
the program run _THAT_ way, we have no problem. :)

Adding a reference to an executable is fine, in my view. Aside from
anything else, it's the only way of writing unit tests against
executables, unless you make the executable *just* a single class which
immediately calls into a DLL.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top