Trouble getting an asset bundle registered I have searched for a couple hours for help on this. No luck.

Following the docs here.

My first two passes were unsuccessful so I deleted everything and started over. 

1) I created a plugin scaffolding with a single controller and successfully registered that plugin. I did not edit anything in that plugin.

2) I created the file "FooBundle.php" in the following folder structure:

recoveryfinder
--myPlugin
  --src
    --FooBundle.php


3) I edited the contents of FooBundle.php to be exactly the docs:

&lt;?php
namespace ns\prefix;

use craft\web\AssetBundle;
use craft\web\assets\cp\CpAsset;

class MyPluginAsset extends AssetBundle
{
    public function init()
    {
        // define the path that your publishable resources live
        $this-&gt;sourcePath = '@ns/prefix/resources';

        // define the dependencies
        $this-&gt;depends = [
            CpAsset::class,
        ];

        // define the relative path to CSS/JS files that should be registered with the page
        // when this asset bundle is registered
        $this-&gt;js = [
            'script.js',
        ];

        $this-&gt;css = [
            'styles.css',
        ];

        parent::init();
    }
}


Lastly I added the following line after my {% extends "base.html" %} in my index.html. My first two lines of index.html look like this:

{% extends "base.html" %}
{% do view.registerAssetBundle("ns\\prefix\\FooBundle") %}


When I refresh my site index page I get:


  ReflectionException
  
  Class ns\prefix\FooBundle does not exist
Because your FooBundle has the classname MyPluginAssetrename your class to FooBundle and it should work (if your namespace is correct, since your information are not really detailed as always)

The docs are not supposed to be a place for copy paste but a source for information.