Add On - Unable to find a module by assembly

Vote:
 

The site is running EPi 8

No Add Ons has been installed previously meaing I have no appData/Modules, appData/ModulesRepository folders and my modulesbin/ is empty

Some config

I've tried installing 2 different add ons (Google analytics and EPiServer.Livemonitor) with the same result.

Unable to find a module by assembly 'EPiServer.LiveMonitor, Version=8.2.0.8000, Culture=neutral, PublicKeyToken=null'

The packages has been installed fine and a reference to the dll for the add on is in place. (The dll is copied to /bin on build)

I can see the resources for the add ons has been added to /modules/_protected

So what is missing in my config that makes the dll's not being found?

#118318
Mar 04, 2015 10:58
Vote:
 

AddOn binaries should be located in probing path - modulesbin/ directory. Does "EPiServer.LiveMonitor.dll" exists in modulesbin/ directory for your installation?

#118336
Mar 04, 2015 15:37
Vote:
 

No it's not in modulesbin/ and I thought that was the way it was suppose to be since I installed it via Nuget in Visual studio (sorry if I was unclear about that)

I guess I've misunderstood what I read here.

http://world.episerver.com/blogs/Linus-Ekstrom/Dates/2015/2/a-first-introductin-to-the-upcoming-episerver-cms-8/

"

  • Installing an add-on as a Nuget package in Visual Studio adds a reference to the assemblies in the package folder. You need to compile to copy the assembly to the bin folder of the site.
  • This means that only assemblies installed through add-ons in the UI ends up in the modulesbin folder while add-ons installed as Nuget packages get their assemblies in the bin folder.

"

I will try to manually add it to the modulesbin/ and see what happens

#118349
Edited, Mar 04, 2015 17:14
Vote:
 

Adding the dll to /modulesbin/ results in this message.

System.ArgumentException: Unable to find a module by assembly 'EPiServer.LiveMonitor, Version=8.2.0.8000, Culture=neutral, PublicKeyToken=null'
Parameter name: moduleAssembly
  at EPiServer.Shell.Paths.ToResource(Assembly moduleAssembly, String moduleRelativeResourcePath)
  at EPiServer.LiveMonitor.Configuration.LiveMonitorSection.get_Instance()
  at EPiServer.LiveMonitor.InitializationModule.Initialize(InitializationEngine context)
  at EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key)
  at EPiServer.Framework.Initialization.InitializationEngine.InitializeModules()

NOTE! Add-ons managed via user interface can temporarily be disabled to make it possible to upgrade or uninstall them, see configuration below. Another alternative is to manage add-ons from Visual Studio, run the cmdlet Convert-EPiAddons from the Package Manager Console (requires that EPiServer.Packaging.UI is installed from NuGet).

<episerver.framework>
 <scanAssembly>
   <add assembly="*" />
   <remove assembly="EPiServer.LiveMonitor" />
 </scanAssembly>


So I ran the cmdlet Convert-EPiAddons without any result.

I'm begining to wonder if I should install this add-on from that feed that is mentioned in the comment section of Linus blog post that I referenced in my previous post?

This feed: https://nugetaddons.episerver.com/feed/addons.svc

I think that is the feed that the packaging UI Add-on installer uses?

#118350
Edited, Mar 04, 2015 17:22
Vote:
 

Trying to read up on this add-on stuff I've concluded that EPiServer.LiveMonitor should be ok to install via NuGet.

That is verified -> http://world.episerver.com/add-ons/installation-support-for-verified-add-ons/

And I've followed the instructions here regarding installing add-ons using NuGet from within Visual Studio

http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/8/add-ons/Installing-add-ons/

It says:

Installing add-ons from Visual Studio

Managing add-ons via Visual Studio is no different from managing any other NuGet package via Visual Studio, this is the default configuration for new sites created in Visual Studio.

There are a few steps that have to be completed to start using add-ons from Visual Studio.

  • Make sure installationMode is set to Code:
    <episerver.packaging installationMode="Code">
  • If the installationMode was set to UI you need to run the cmdlet 'Convert-EPiAddons' in the Package Manager Console, it will convert any existing add-ons installed via UI to Visual Studio format
  • Make sure http://nuget.episerver.com is added as a NuGet source.
  • It should now be possible to install and upgrade add-ons as normal via Visual Studio.

So no mentioning of having to manually copy the dll for the add-on to modulesbin/ (which didn't do me any good anyway) =)

#118360
Mar 04, 2015 21:31
Vote:
 

Solved it!
The problem was a mismatch in the following configs (no idea how that happened)

This is what I'm running with now and add-ons work like expected. =)

 <episerver.shell>
    <publicModules rootPath="~/modules/" autoDiscovery="Modules" />
    <protectedModules rootPath="~/episerver/">

<episerver.packaging protectedVirtualPath="~/episerver/" protectedPath="modules\_protected" installationMode="Code" />

<add name="ProtectedAddons" virtualPath="~/episerver/" physicalPath="modules\_protected" type="EPiServer.Web.Hosting.VirtualPathNonUnifiedProvider, EPiServer.Framework" />



#118467
Mar 06, 2015 16:02
Vote:
 

I am having the exact same problem. But with all our modules.

EPiServer.GoogleAnalytics

EPiServer.Labs.LanguageManager

EPiServer.Social

and EPiServer.Commerce.Shell.ManagerIntegration

The website refuses to work unless I disable them all like this:

<scanAssembly>
<add assembly="*" />
<remove assembly="EPiServer.Social" />
<remove assembly="EPiServer.Labs.LanguageManager" />
<remove assembly="EPiServer.GoogleAnalytics" />
<remove assembly="EPiServer.Commerce.Shell.ManagerIntegration" />
</scanAssembly>

This is the line of code that is failing according to the stacktrace:

EPiServer.Shell.Paths.ToResource(Assembly moduleAssembly, String moduleRelativeResourcePath) +319

(It's the same problem for all our modules now)

This happened after trying to upgrade EPiServer.Packaging and trying to migrate to installationMode="Code".

I have compared our config files with what Peter Gustafsson posted as a solution and noted that we were missing the attribute protectedPath="modules\_protected" on the <episerver.packaging> element but adding that attribute makes no difference at all.

All the dlls are present in the bin folder. The modulesbin folder is empty but putting the dlls there as well makes no difference at all (and NuGet removed them from there for me).

I have also made sure that the web application does have proper permissions on the modules/_protected folder.

So what have I missed?

It must be something more with the config files or what else?
#121845
May 18, 2015 17:27
Vote:
 

Sorry for the weird formatting that happened there  but I cannot find any way to edit my post?

#121846
May 18, 2015 17:28
Vote:
 

We are having a similar issue but only when trying to unit test an AddOn's controller:

public override ActionResult Index(CommentBlock currentBlock)       

{           

     var view = Paths.ToResource(this.GetType(), "Views/CommentBlock/CommentBlock.cshtml");           

     return PartialView(view, currentBlock);       

}

Exception:

{"Unable to find a module by assembly 'EPiServer.Social, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'\r\nParameter name: moduleAssembly"}

Stack:

at EPiServer.Shell.Paths.ToResource(Assembly moduleAssembly, String moduleRelativeResourcePath)
at EPiServer.Shell.Paths.ToResource(Type typeInModuleAssembly, String moduleRelativeResourcePath)
at EPiServer.Social.Controllers.CommentBlockController.Index(CommentBlock currentBlock) in c:\Users\ccolon\Source\Repos\EPiServer.Social\Social\EPiServer.Social\Controllers\CommentBlockController.cs:line 36
at EPiServer.Social.Tests.CommentBlockControllerTests.Index_Get_Should_Lookup_Comments_From_Repository_And_Return_CommentBlock_View() in c:\Users\ccolon\Source\Repos\EPiServer.Social\Social\EPiServer.Social.Tests\CommentBlockControllerTests.cs:line 79

It works fine in a site.  Any ideas what we may need to do to the unit test project config to make this work?

Thanks!

#123084
Edited, Jun 24, 2015 15:23
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.