oqtane.framework: Cannot find compilation library location for package 'System.Drawing.Common'

While testing our oqtane module instalation to see that all referenced 3rd party dependencies are included in nupkg I got the error: “Cannot find compilation library location for package ‘System.Drawing.Common’”.

The error happens in clean oqtane 2.0.2 installation, hosted on IIS 10, while running our module instance on the page. I’m not aware that we are using anything from System.Drawing.Common, but we are using oqtane framework a lot, so I search for it in the oqtane source code and I see that is added as a package reference to Oqtane.Server project.

<PackageReference Include="System.Drawing.Common" Version="5.0.0" />

Is it possible that this dll have to be included as part of the oqtane install zip?

If not, we need to include in our oqtane module nupkg because it is not working without it.

Error

Error: System.AggregateException: One or more errors occurred. (Cannot find compilation library location for package 'System.Drawing.Common') ---> System.InvalidOperationException: Cannot find compilation library location for package 'System.Drawing.Common' at Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths(ICompilationAssemblyResolver resolver, List`1 assemblies) at Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths() at Microsoft.AspNetCore.Mvc.ApplicationParts.AssemblyPartExtensions.<>c.<GetReferencePaths>b__0_0(CompilationLibrary library) at System.Linq.Enumerable.SelectManySingleSelectorIterator`2.MoveNext() at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.RazorReferenceManager.GetReferencePaths() at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.RazorReferenceManager.GetCompilationReferences() at System.Threading.LazyInitializer.EnsureInitializedCore[T](T& target, Boolean& initialized, Object& syncLock, Func`1 valueFactory) at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.RazorReferenceManager.get_CompilationReferences() at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.LazyMetadataReferenceFeature.get_References() at Microsoft.CodeAnalysis.Razor.CompilationTagHelperFeature.GetDescriptors() at Microsoft.AspNetCore.Razor.Language.DefaultRazorTagHelperBinderPhase.ExecuteCore(RazorCodeDocument codeDocument) at Microsoft.AspNetCore.Razor.Language.RazorEnginePhaseBase.Execute(RazorCodeDocument codeDocument) at Microsoft.AspNetCore.Razor.Language.DefaultRazorEngine.Process(RazorCodeDocument document) at Microsoft.AspNetCore.Razor.Language.DefaultRazorProjectEngine.ProcessCore(RazorCodeDocument codeDocument) at Microsoft.AspNetCore.Razor.Language.RazorProjectEngine.Process(RazorProjectItem projectItem) at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.RuntimeViewCompiler.CompileAndEmit(String relativePath) at Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.RuntimeViewCompiler.OnCacheMiss(String normalizedPath) --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Razor.Compilation.DefaultRazorPageFactoryProvider.CreateFactory(String relativePath) at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.CreateCacheResult(HashSet`1 expirationTokens, String relativePath, Boolean isMainPage) at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.LocatePageFromPath(String executingFilePath, String pagePath, Boolean isMainPage) at Microsoft.AspNetCore.Mvc.Razor.RazorViewEngine.GetView(String executingFilePath, String viewPath, Boolean isMainPage) at ToSic.Sxc.Razor.Engine.RazorCompiler.FindView(ActionContext actionContext, String partialName) at ToSic.Sxc.Razor.Engine.RazorCompiler.CompileView(String partialName, Action`1 configure) at ToSic.Sxc.Razor.Engine.RazorRenderer.RenderToStringAsync[TModel](String partialName, TModel model, Action`1 configure) at ToSic.Sxc.Razor.Engine.RazorEngine.RenderTask() --- End of inner exception stack trace --- at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at ToSic.Sxc.Razor.Engine.RazorEngine.RenderTemplate() at ToSic.Sxc.Engines.EngineBase.Render() at ToSic.Sxc.Blocks.BlockBuilder.Render()

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (12 by maintainers)

Most upvoted comments

System.Drawing.Common is only being used in the file upload to determine the dimensions of image files. These dimensions are used in the File Manager component to render a thumbnail with the correct aspect ratio. In a development environment, the System.Drawing.Common.dll is included in the /bin folder. It is very strange that doing build for release does not include the DLL. It definitely needs to be included - I can definitely add logic to include it manually.