Search code examples
c#.netwpfuser-controlsvisual-studio-2022

WPF UserControl Given Assembly Name or Codebase is Invalid


I am learning WPF right now and building a simple application to generate an Ulam Spiral. Right now I want to implement my own spinner when the program is calculating the spiral. My plan is to create a UserControl as the spinner and then display it in the main window.

However, when I am testing the spinner in the main window, I got "Given assembly name or codebase is invalid" error. I've tested using a completely empty solution, it worked. But, if I use it in my project, it does not work. I tried cleaning and rebuilding the solution, it still does not work. I don't understand what I'm doing wrong.

Can somebody help me? I'm attaching the whole solution here. I'm really frustrated right now.


Solution

  • I run your code doing the following:

    1. Visual Studio -> remove ' from your project's name to be Ulams Spiral instead of Ulam's Spiral (following this suggestion)
    2. Visual Studio -> Build -> Configuration Manager -> new Platform : add x64
    3. Note that you have an error in MainWindow.xaml -> Replace <local:Spinner /> with <local:UlamSpinner />
    4. Rebuild and run.