Workaround for compilation problem #3

Closed
davidfowl opened this Issue Jul 15, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@davidfowl

davidfowl commented Jul 15, 2016

The problem is a known issue with 1.0.0 and how MVC finds compilation assemblies for class libraries in particular. You can workaround the issue by adding the modules assemblies to the list of compilation assemblies directly.

Replace https://github.com/thiennn/trymodular/blob/master/Modular/src/Modular.WebHost/Startup.cs#L71 with the following:

var mvcBuilder = services.AddMvc()
        .AddRazorOptions(o =>
        {
            foreach (var module in modules)
            {
                o.AdditionalCompilationReferences.Add(MetadataReference.CreateFromFile(module.Assembly.Location));
            }
});
@thiennn

This comment has been minimized.

Show comment
Hide comment
@thiennn

thiennn Jul 15, 2016

Owner

Yeah, it works

Owner

thiennn commented Jul 15, 2016

Yeah, it works

@thiennn thiennn closed this Aug 31, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment