Incorrect template key when using constructor that takes assembly
See original GitHub issueWhen I’m using the constructor of EmbeddedRazorProjectItem
it’s setting the template key to assembly.GetName().Name, which will not include the namespace. So the embedded views aren’t found, and there’s no way to override it.
I believe the issue is in this line: https://github.com/toddams/RazorLight/blob/744f545227083f17c63bcdef989bd5c2017ef53b/src/RazorLight/Razor/EmbeddedRazorProjectItem.cs#L23
There is also an issue that both the RootNamespace and Assembly properties that are exposed in the class have the setter exposed, but changing them won’t do anything, the fullTemplateKey
is only set in the constructor.
Suggested fixes:
- Fix the constructor that takes an assembly so the full namespace is included, or require the root namespace to be specified (and overriding the full key)
- Either remove the settings on the properties, or implement it properly so setting them will change the
fullTemplateKey
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
templates, function uses wrong constructor to copy my object
I created a class template that initializes a simple array using the parameter pack expansion and the class has a copy constructor for...
Read more >c++ - Problem using template with Default constructor.
This is supposed to be a constructor... I assume that if I create a new class using code: new vector(); then it should...
Read more >Java Method/Constructor in Class Cannot be Applied to ...
This error is triggered by a method call attempted with the wrong number, type, and/or order of arguments. Arguments are the actual data...
Read more >[accepts invalid] binding template template arguments with ...
[accepts invalid] binding template template arguments with mismatched signatureUnder ... {}; template typename Templ> using S = int; using T = template_;.
Read more >An Idiot's Guide to C++ Templates - Part 1
Here we use the keyword template to let compiler know that we are defining a function template. Function Templates. Here is the templated ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If I reformatted everything could you re-do the PR after that.
Can this PR be merged please. This is a major bug for us using this library. We have no way around this particular issue that I can find at the moment.