Simsons
Simsons

Reputation: 12745

Getting XMLNS name not found error though class exist in namespace

enter image description here

I am trying to refer IntegerUpdown from xceed.wpf.Toolkit namespace . When I use object browser I could see IntegerUpdown but while building I am getting the error:

Error 15 The name "IntegerUpDown" does not exist in the namespace "clr-namespace:Xceed.Wpf.Toolkit;assembly=WPFToolkit.Extended".

Upvotes: 12

Views: 2196

Answers (2)

user1132
user1132

Reputation: 1

I also ran into this one, and it drove me crazy for the better part of a day. My app compiled and ran OK, but the designer couldn't display my UI - a real problem since I was still working on that UI.

Things I tried that didn't work:

  • Clean and rebuild the app.
  • Unload and reload the project.
  • Restart Visual Studio.
  • Reinstall with Nuget.
  • Switch between Debug and Release configurations.
  • Switch between x86 and x64 platform targets.
  • Specify the namespace alias using an explicit namespace/assembly reference rather than the URL reference shown in LightSwitch's snippet above.

Finally, after much gnashing, I discovered this article that shed some light. In a nutshell, since the assemblies came from an external source (in this case, a Codeplex project), Windows set the Blocked flag on each of the assembly files. To remedy this, simply right-click on each file and view its Properties dialog; if an Unblock button is shown on the bottom, click it to clear the block. (This assumes, of course, that you trust the provenance of those assemblies - caveat emptor.)

One additional step (not mentioned in the aforementioned article) may be needed. If your project has references to the problem assemblies that were created before you unblocked the file(s), you may need to remove those references and re-add them to refresh them.

Good luck!

Upvotes: 0

Ayyappan Subramanian
Ayyappan Subramanian

Reputation: 5366

WPFToolKit defined a alias or custom namespace http://schemas.xceed.com/wpf/xaml/toolkit. Refer below.

<Window x:Class="WPFComm_Learning.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:tool="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <StackPanel>
            <tool:IntegerUpDown/>            
        </StackPanel>
    </Grid>
</Window>

Upvotes: 7

Related Questions