-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET 6 - Functions v4 #3
Comments
Hi, Thanks for your detailed question! I just tried to convert it to .NET 6, and I'm running into the same problem as you do. The 2 lines, together with But because the .NET 6 Razor compiler no longer produces a Views assembly, the views should be included in the main dll. So that code is not necessary anymore. So I think there could be 2 things happening:
In the linked github discussion it looks like someone found out how to find the views, but I have not read that in detail yet. I will try to look into this soon, but I have little time the coming days. |
Okay, so I did not manage to make it work. But I think I have at least some interesting information to share, so that either one of us can continue trying to fix this. First things first: I have managed to make it work differently, using the [Razor.Templating.Core] package and following the tutorial here. The person who made this package also is engaging in the discussion you mentioned. However, after reading your reply I continued working on trying to make this example work, as I preferably don't rely on external packages and in your example everything is dependency injected, instead of relying on a static class to do the rendering for us. Furthermore this problem just grabs me. So I refactored and changed your code a bit into this. Then I tried upgrading again and, given your explanation about the two lines I asked about, I removed those lines. The var services = builder.Services;
services.AddSingleton<IStringLocalizerFactory, ResourceManagerStringLocalizerFactory>();
services.AddScoped<IRazorViewRenderer, RazorViewRenderer>();
services.AddSingleton<ObjectPoolProvider, DefaultObjectPoolProvider>();
services
.AddMvcCore()
.AddViews()
.AddRazorViewEngine(); Sadly I still run into an error, but I think that that one is exactly telling us about what problem needs to be solved.
As the creator of aforementioned package might have run into this exact same problem, I think it might be worthwhile to investigate their code, which is open source as well. |
Hi @EtiennePeeters and @RichardPoes, |
I did not. In the end I went to solve my problems with Blazor |
Hi,
A little far fetched maybe, but when I try to port this to .NET 6.0 with Functions v4 I first got the following error:
This is because in v4/NET6 this dll is not generated. Therefore I thought, let's change the line
to
Upon which the whole project can build, but when trying to run the function, I get the exception:
I'm still studying how your example exactly works, so maybe I will be able to find out on my own.
Specifically I'm investigating what the these two lines below, listed inside the
Configure
method inside theStartup
class, are doing.But please let me know if you have any ideas.
The text was updated successfully, but these errors were encountered: