Open jtsom opened 3 weeks ago
Quick followup, adding a new endpoint:
app.MapGet("/test", () => Results.Extensions.RazorSlice<net8test.Slices.Hello, TestClass>(new TestClass()));
Does build and work without exception. but again, I had to add the net8test
namespace to get the .Slices
.
Hmmm could be an issue with project directory name casing. Can you create a minimal repro project?
Hmmm could be an issue with project directory name casing. Can you create a minimal repro project?
There is one in the original report. I thought that also. The original .csproj file was all lower case, I renamed it, but it didn't make a difference.
After renaming the enclosing folder, and anything else in the project that was lower case, and cleaning and rebuilding a couple times, it looks like it's doing the right thing now.
Even thought VSCode still things there's an error:
Everything builds and runs successfully. Quitting and relaunching VSCode didn't help. I blame the C# dev kit...
I updated a test app with the latest version.
The first thing I found was I had to change the way rendering to a string was done. I have a
Slices
folder with aHello.cshtml
file. I have a simple class to pass in some data:To get html, in the previous version, all I did was:![image](https://github.com/DamianEdwards/RazorSlices/assets/13488/8170617e-8247-44f5-9af5-b334624fb769)
Now, with the latest changes I need to do:![image](https://github.com/DamianEdwards/RazorSlices/assets/13488/96cb7793-79b9-4e74-830b-5b9362da0105)
Note - in line 36, I have to use a lower-case version of the app class -![image](https://github.com/DamianEdwards/RazorSlices/assets/13488/bd8b14d1-a8bd-4787-80ee-550a52c2201d)
net8test
vsNet8Test
.Net8Test
does not have the.Slices
memberOnce built I tried a test, but an exception was thrown, pointing to a source generator problem:
net8test (2).zip