trymodular icon indicating copy to clipboard operation
trymodular copied to clipboard

Modules not loaded

Open edwardwilson opened this issue 9 years ago • 8 comments

Hello, I cloned this repository and found that none of the modules are loaded correctly. Can someone tell me if I am missing something which needs to be set up?

edwardwilson avatar Aug 30 '16 15:08 edwardwilson

Please post detail the error messages or screenshots

thiennn avatar Aug 31 '16 02:08 thiennn

I've downloaded the repository opened and complied. I've ran the app in IISExpress and the site loads fine:

image

However when I click on one of the module links I get a blank page:

image

When I look in the dev tools of my browser it's getting a 404 response:

image

edwardwilson avatar Aug 31 '16 10:08 edwardwilson

Did you build the whole solution? Because modules are on different projects that are not referenced by the WebHost, they do not be built automatically.

thiennn avatar Aug 31 '16 15:08 thiennn

Running this on Mac and i get this error :

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileLoadException: Could not load file or assembly 'Modular.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
   at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
   at Modular.WebHost.Startup.LoadInstalledModules() in /Users/cevarief/Development/aspnet/git/trymodular/Modular/src/Modular.WebHost/Startup.cs:line 188
   at Modular.WebHost.Startup.ConfigureServices(IServiceCollection services) in /Users/cevarief/Development/aspnet/git/trymodular/Modular/src/Modular.WebHost/Startup.cs:line 58
   --- End of inner exception stack trace ---

I find that Modular.Core.dll is already in bin folder.

cevarief avatar Nov 25 '16 00:11 cevarief

The newer version of .net core run don't throw a good exception message. Please try to remove the checking if (ex.Message == "Assembly with same name is already loaded") as I did here https://github.com/simplcommerce/SimplCommerce/blob/master/src/SimplCommerce.WebHost/Extensions/ServiceCollectionExtensions.cs

thiennn avatar Nov 28 '16 04:11 thiennn

Thanks it works now.

I'm wondering if the route can be changed to localhost:5000/moduleA/TestA instead of localhost:5000/TestA/ to avoid routing conflict with core module.

cevarief avatar Nov 28 '16 06:11 cevarief

try AttributeRouting

thiennn avatar Nov 28 '16 10:11 thiennn

Well, attribute Routing is not my preference, since it needs to add it to every module controller. I've just extended the global default route to make it work, the only problem is i could now access both uri /moduleA/TestA and /TestA/. But that's no problem anyway.

Thank you very much.

cevarief avatar Nov 28 '16 11:11 cevarief