Open loukikbhandari opened 5 years ago
@toddams Have you came across this issue with docker containers having net core apps
@loukikbhandari I've found that workaround https://github.com/toddams/RazorLight/issues/217#issuecomment-428539715
@loukikbhandari is your publish profile set to self contained or framework dependent. I am deploying to a windows machine, with SelfContained as true in publish profile and have this issue as well. So I have a feeling its related to that.
@SirMrDexter I wanted to add another data point, as I'm having this issue with SelfContained = false in my publish profile. So not sure that is the issue.
@SyntaxErrorOnLine1 Are you using a docker container? I just updated the FAQ with a bunch of information.
As a request, I wish people who ARE running in a container please upload to GitHub a sample project with the Dockerfile. It should lead to 100% reproducible problem.
@jzabroski No, I'm not. I've just resolved my issue (I think - it's still to be fully tested) by setting MvcRazorCompileOnPublish = true in my project file, so it's likely that it's a different issue to the OP, but was giving the same error message. Sorry for the false positive.
I can confirm exactly the same problem with .net core 2.2. It was resolved by applying the instructions from the FAQ. Thanks.
@mcrio thanks for your feedback.
Hello , I am getting this error while running docker container with Net core 2.2 project which has following code
string result = await engine.CompileRenderAsync("Header.cshtml", Resource.Header, headerModel);
Expected behavior Should compile and render html
Information (please complete the following information):
Error occurred: System.InvalidOperationException: Cannot find compilation library location for package 'Microsoft.AspNet.WebApi.Client'\\n at Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths(ICompilationAssemblyResolver resolver, List
1 assemblies)\\\\n at Microsoft.Extensions.DependencyModel.CompilationLibrary.ResolveReferencePaths()\\\\n at System.Linq.Enumerable.SelectManySingleSelectorIterator
2.MoveNext()\\n at RazorLight.Compilation.DefaultMetadataReferenceManager.Resolve(DependencyContext dependencyContext)\\n at RazorLight.Compilation.RoslynCompilationService.EnsureOptions()\\n at RazorLight.Compilation.RoslynCompilationService.get_ParseOptions()\\n at RazorLight.Compilation.RoslynCompilationService.CreateSyntaxTree(SourceText sourceText)\\n at RazorLight.Compilation.RoslynCompilationService.CreateCompilation(String compilationContent, String assemblyName)\\n at RazorLight.Compilation.RoslynCompilationService.CompileAndEmit(IGeneratedRazorTemplate razorTemplate)\\n at RazorLight.Compilation.RoslynCompilationService.CompileAsync(IGeneratedRazorTemplate razorTemplate)\\n--- End of stack trace from previous location where exception was thrown ---\\n at RazorLight.Compilation.TemplateFactoryProvider.CompileAsync(IGeneratedRazorTemplate razorTemplate)\\n at RazorLight.Compilation.TemplateFactoryProvider.CreateFactoryAsync(String templateKey)\\n at RazorLight.RazorLightEngine.CompileTemplateAsync(String key)\\n at RazorLight.RazorLightEngine.CompileRenderAsync(String key, Object model, Type modelType, ExpandoObject viewBag)\\n at