0

I am working on a wpf/VB project that is a front end to an SQL 2015 database.

My Application.xaml includes this snippet:

xmlns:local="clr-namespace:MyApp "

<Application.Resources>
    <local:MyDataSet x:Key="dsApp" />
</Application.Resources>

where MyApp is the application and MyDataSet is, well, my data set.

In code behind, I have

dsApp = CType(Application.Current.FindResource("dsApp"), MyDataSet)

This gives the following Error: 'The name "MyDataSet" does not exist in the namespace "clr-namespace:MyApp"' However, the project compiles and runs just fine and connects to the database, returning the required data.

Why am I getting this erroneous error messsage?

ETA: All of my wpf windows are giving the same error message for the "local:" declarations in my XAML. That is apparently where the error(?) is located by I sure don't see it.

SezMe
  • 479
  • 6
  • 21
  • I have - a dozen times. What is wrong with: xmlns:local="clr-namespace:MyApp" – SezMe May 01 '16 at 06:20
  • where exactly this line is written : `dsApp = CType(Application.Current.FindResource("dsApp"), MyDataSet)` – AnjumSKhan May 01 '16 at 06:21
  • 1
    I always get thsoe errors. But recompiling fixes it – wingerse May 01 '16 at 06:31
  • This seems to be pretty common. I often see it when switching from debug to release. I'm guessing it's because, at this point, the referenced items have not been built, but the IDE is smart enough to know that this isn't a showstopper. Doing a build removes the error. – peterG May 01 '16 at 13:55
  • The switching from x64 to x86 and back fixed the problem as noted in the linked article. I would like to comment that the comments in that piece use Solution Properties and Project Properties as if they are interchangeable. THEY ARE NOT THE SAME THING! – SezMe May 02 '16 at 07:20
  • Well, I take that back. My problem remains. I'll go over to the link to see if I can find something else that might work. – SezMe May 03 '16 at 14:37

0 Answers0