Did you get here because you don't understand how "Rendermode Auto" works?
Remember: a child component cannot redefine the render type if it is defined in the parent component. This means that if the parent ordered to draw in Server mode, then any child components should work as a Server. This is an important point to remember.
One more thing to remember: the Auto render type is NOT a combination of Server and Client. It just means that your application decides for itself how to draw child components: either in the Server or in the Client.
Therefore, if you are making a class library, then your component must be adapted to the Server and Client.
Don't you understand how to use it then? Remove all references "rendermode" in your app. Assign the Server rendering type to your navigation menu, and the Client type to the page. In this case, when you launch the application, the menu will work directly with the server, and the page is only in the browser.
Can't figure out how to work with services in Auto mode? Your server and client have SEPARATE services. This means that when the application is running in Server mode and decides to switch to the Client, the component that has a service injection will be replaced with a service from the Client, and the OnAfterRender method will be called again.
Are you confused and don't understand how to adapt a component to different rendering modes? Use the RenderInfo property. Thanks to it, you can determine which mode the component is currently operating in.
Correct me if I've made a mistake. I had to try and test for a long time to understand all this.