Hi again,
I have now purchased a pro subscription for the RDS IDE. How can I benefit from the dedicated support now? I want to fix this issue with the build step
Hi again,
I have now purchased a pro subscription for the RDS IDE. How can I benefit from the dedicated support now? I want to fix this issue with the build step
Hi @iustin94,
I am afraid we would have to refund your purchase as there isn't any way we can debug this on your machine.
I will give some try to making it work still, if in the end it is not possible then I will get back to you on that.
I just saw that the refund was already made. Is this reversible or should I get a different license once the refund comes back?
No, the refund is not reversible. Please don't make another purchase as every refund costs us money.
I managed to get the default RDS app to build correctly. After creating a new app and getting this error:
I went in the folder of the App.razor file and added a partial class for it:
Following this stackoverflow thread:
It seems that for whatever reason the way RDS is using the build tool is not detecting the namespaces correctly.
I have narrowed it down further. The issue is specific to any namespace or component that is being imported in the Program.cs file.
Where is a newly made application using Rider IDE. The Program.cs is scaffolded and the Components and Account namespace is added by default for the App and the IdentityComponents endpoint mappings.
These are the exact namespaces that RDS gives error that it can not find when trying to build.
It seems that the issue is related to the compatibility with the way razor pages work. A project created with the Identity pages by the dotnet cli causes RDS to fail to build. RDS coincidentlly gets arround it by providing the modernized approach to identity pages which is great since that's what the dotnet team should have done already instead. The issue is now that it forces those who have a project already and want to port it, to do a big change in one go by whiping out the old identity pages. and using RDS to scaffold them. This however does not address the fact that even the App.razor can not be imported. I will try setting up a VM and on a clean installation of .net9 see if this reproduces
I managed to reproduce the same issue.
Using an Ubuntu 24.04.1 image, I downloaded the RDS app image, installed fuse2 on the OS and .net9 following the instructions from .net:
Installation completed fine and RDS started with no issues. I created the base web app from RDS and after build step fails I see the same output error.
I'm surprised more have not mentioned this issue as it seems to affect any linux environment
It seems the problem is caused by .NET 9 on Linux. We just published a new version which should address the problem.
Thank you, it works now.
Hey again, I know that this is frustrating but the error came back again However, please don't refund the subscription since I have all the other reasons for having it.
This time a bit weird. You can see in the screenshot that the error is given at line 35. Though the error is at line 37. I can work around it by adding a codebehind file for forcing the namespace, but it seems like an issue since you can't have components without the codebehind.
Additionally, even if the build says it passes, when trying to view any of the components most of them can't be rendered because the namespace that their containing directory would generate can not be found.
at Radzen.Server.ProjectContext.Compile(Compilation compilation, AssemblyLoadContext context)
at Radzen.Server.ProjectContext.Compile(Compilation compilation)
at Radzen.Server.ProjectServer.Compile(String fileName, String source, RazorProjectEngine projectEngine)
at Radzen.Server.ProjectServer.CompilePage(String fileName, String source, RazorProjectEngine engine)
at Radzen.Server.ProjectServer.Render(String fileName, String source, Boolean renderLayout)
at Radzen.Server.ProgramController.Render(RenderRequest request)
That's quite strange. What did you change?
We can't reproduce this error any more with the latest release of RBS so we don't know what could have caused it.
A possible workaround is to use <RootNamespace>
in your csproj file (if it is not used already). Sometimes after renaming a project the directory name and namespace no longer match.
The issue with the App domain I have it happening in the empty virtual machine too. I created a new project with RDS to be sure it's nothing in my local configs that causes this and I still get the error with the App namespace missing which I can manually fix by adding a partial class to the App.razor.
I do actually have the root namespace tag in the project.
I am wondering if the "." inside it can confuse the resolution.
The issue affects most of the component design view.
For example this component
GIves this error when I try to view the design:
at Radzen.Server.ProjectContext.Compile(Compilation compilation, AssemblyLoadContext context)
at Radzen.Server.ProjectContext.Compile(Compilation compilation)
at Radzen.Server.ProjectServer.Compile(String fileName, String source, RazorProjectEngine projectEngine)
at Radzen.Server.ProjectServer.CompilePage(String fileName, String source, RazorProjectEngine engine)
at Radzen.Server.ProjectServer.Render(String fileName, String source, Boolean renderLayout)
at Radzen.Server.ProgramController.Render(RenderRequest request)
And you can see it's importings here:
But a component that has the same hierarchy place renders fine:
The difference being perhaps in the source code:
I am confused. You first said that the issue is resolved with the latest version when creating a new application in RBS. Now you say the issue is happening again. Meanwhile we haven't released an update of RBS so I don't know what could have caused the problem to appear again.
To be honest I couldn't understand if the issue appears in a new project (created with RBS) or not. Can you clarify this?
Yea so the issue was solved on that project and I opened it and it worked, but the reason why it worked was because I had the partial class for App made inside of it from the last try. The partial class makes the App namespace be detected. So that was that reason why it was "fixed" because that workaround was still there.The push you made solved the issue with the namespaces not being detected on build, on the default app.
FInally, I also identified the reason why some of the assemblies are not detected. In my solution I hace several projects. For each project I defined a dependencies file for adding the services. This breaks the RDS rendering.
Now, I moves all the code from the separate files, in my Program.cs, to confirm my theory and indeed, now after putting all of it in 1 big file, the components render as expected in the RDS view.
In the end this is a workaround I have to make in my project so that the RDS is able to resolve the namespaces and show me the components. It would be however good to not be forced to make structure changes. This is not an issue in my IDE so something is different in how RDS is building the project
So, to clarify, yes the issue still happens on a new project.
When I create a blank project i get the "App not resolved" error. To fix this, I need to a codebehind file for the App.razor so that the namespace is detected.
Any service added to the project outside of the Program.cs is not resolved by the dependency injector in RDS when I try to view the design component. This is not an issue in my IDE and should be supported by the build tool as far as I can tell.
These are the 2 issues that I found workarounds for.
We can't reproduce this problem with the latest version on a Linux distro. A new application does not seem to have such a problem. Does restarting RBS and reopening the app make any difference?
At the moment only services registered in the program.cs file are available in design time.
I installed Ubuntu 24.04 in a virtual machine. Then following the microsoft instructions how to install .NET 9 SDK (what you have linked):
sudo add-apt-repository ppa:dotnet/backports
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-9.0
Then installed fuse2 (required to run appimage files):
sudo apt install libfuse2
Finally downloaded the linux version of Radzen Blazor Studio, right clicked it and enabled Executable as Program:
Then I created a new Blazor app with server rendering. Everything went normal. The app displayed as expected in design time without any build errors.
Here is the Ubuntu about dialog:
WASM app works as expected too.
This is all to show that we can't reproduce the problem in a new app created by Radzen Blazor Studio 1.36.2.