1

Dear community member.

While I have programmed in C# for a number of years, I must admit that I am new to WPF and Infragistics controls. Recently I came across an unexpected compile time error and I was wondering what might be causing it:

The type or namespace name 'Controls' does not exist in the namespace 'Sandbox.WpfApp' (are you missing an assembly reference?)

Thoughts?

STEPS TO REPRODUCE

  1. Create a WPF project
  2. Add a XamGrid to MainWindow.xaml
  3. This step is important: name the XamGrid
    • <ig:XamGrid x:Name="abc">
  4. Compile and run the application... everything is ok!
  5. Create an Infragistics folder within the project
  6. Add a WPF user control to the Infragistics folder
  7. Compile the application: the before mentioned error is generated

What is interesting is:

  • if you remove x:Name="abc" from the XamGrid => no compile-time error
  • if at step #5 you had named the folder "IntragisticsTest" => no compile-time error

ADDITIONAL CONTEXT*

  • Infragistics WPF4 controls (version: 12.2.20122.1000)
  • Visual Studio 2013
Pressacco
  • 2,815
  • 2
  • 26
  • 45
  • 1
    This is a namespace conflict that occurs when you don't use `global::`. What line of source generates the error? – SLaks Mar 13 '14 at 14:51
  • http://blogs.msdn.com/b/ericlippert/archive/2010/03/11/do-not-name-a-class-the-same-as-its-namespace-part-two.aspx – SLaks Mar 13 '14 at 14:51
  • Thanks for the feedback SLaks, much appreciated! The compile-time error points to the `ig:XamGrid` definition in the XAML. – Pressacco Mar 13 '14 at 14:53
  • @SLaks: I have never seen naming conflicts expressed quite this way before, but perhaps you are right. If I follow the the *STEPS TO REPRODUCE* and create a class named *Infragistics* (instead of the folder)... I see the same result => *The type or namespace name 'Controls' does not exist in the namespace* – Pressacco Mar 13 '14 at 15:04
  • Assuming it is a namespace conflict, do you know why the error goes away when I remove the x:Name="abc" property from the `XamGrid`? – Pressacco Mar 13 '14 at 15:12
  • 2
    Because then you never end up using their `Infragistics` namespace in C# source. – SLaks Mar 13 '14 at 15:13

0 Answers0