blogifierdotnet / Blogifier

Blogifier is an open-source publishing platform Written in ASP.NET and Blazor WebAssembly. With Blogifier make a personal blog or a website.
https://blogifier.net
MIT License
1.28k stars 518 forks source link

Can't load my created ClassLibrary in the Controller. #123

Closed tanshanli closed 5 years ago

tanshanli commented 5 years ago

Current behavior

Can't load my created ClassLibrary(TargetFramework netcoreapp2.1) in the AdminController. but,The program is not interrupted. error.png

However. Variables(my created ClassLibrary) in App/Program.cs or App/Startup.cs can be displayed normally. normal.png

Expected behavior

Variables(my created ClassLibrary) in the AdminController can be displayed normally.

Try

When I created a new project(net core 2.1 mvc),Reference to the same ClassLibrary,Everything's fine.

Environment

Version: Blogifier\App 1.0.0, TargetFramework: netcoreapp2.1 Tool: VS2017 15.9.4 OS Version and name: win10 1803

rxtur commented 5 years ago

If you look at Plugins.Common project, it is external class library that references Core. It includes views, controllers and classes that interact with Blogifier. The only thing that required for Blogifier to instantiate and run this library is set product attribute to start with Blogifier.. At startup, Blogifier will check all DLLs in the ~/bin for this attribute and load library as plugin. This way you don't have to mess with core application code and rebuild it on every upgrade.

tanshanli commented 5 years ago

If you look at Plugins.Common project, it is external class library that references Core. It includes views, controllers and classes that interact with Blogifier. The only thing that required for Blogifier to instantiate and run this library is set product attribute to start with Blogifier.. At startup, Blogifier will check all DLLs in the ~/bin for this attribute and load library as plugin. This way you don't have to mess with core application code and rebuild it on every upgrade.

thx