Closed HakanL closed 4 years ago
I believe the current code worked when the name of the project (assembly) was the same name as the beginning of the namespace (RazorLight.Tests for example), but it fails when the project has a different name than the namespace (like name of project is SharedResources but the namespace is Company.Resources). I will submit a PR.
Can you please undo all the whitespace changes. It makes it hard to review? Otherwise, I am happy to accept this PR - your change sounds logical but I just dont want to push it with all these whitespace noise issues and possibly introduce something unexpected.
Thank you very much! As soon as updated, will try to do a new release.
Sorry about that, but it's just the normal reformat that Visual Studio does to make it consistent (tab vs space).
The source files have a mix of tab and space already. I don't know how I can easily undo the whitespace changes, VS reformats it automatically for me. In TortoiseGIT I can just turn on "ignore whitespace changes" to just see the code changes, could you try that?
I think BitBucket has an ignore whitespace feature, but I dont think GitHub does.
Good point on Visual Studio applying style changes. Should format the whole solution and check in a settings file so that people can hop into the project to reduce issues. Thougths?
Yes, that would be very good to have it all re-formatted, at least in the files I was changing it was mixed up.
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.
When 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:
fullTemplateKey
.