Thank you!
I will try to investigate more, it is strange that it runs the app without complaining from within Blazor Studio but can not build any pages
only thing I can think of is that the directory of the referenced project is one level above the folder where the solution file resides ;
I cannot debug Blazor Studio, but I have removed the project reference and referenced the DLL directly. This resolves the issue, but it does not give any closure on why a project reference to ".NET Standard 2.0 targeted" is not accepted to build the app to visually be able to edit the page.
The source code for the referenced project was auto-generated by xsd tool.
The next issue arises now that I have eliminated the prior issue.
I have a string extension in my "project.Pages" namespace like this:
public static class StringExt
{
public static string Truncate(this string value, int maxLength, string truncationSuffix = "…")
{
return value?.Length > maxLength
? value.Substring(0, maxLength) + truncationSuffix
: value;
}
}
Blazor Studio now complains "The page cannot render" and logs:
error CS0121:
The call is ambiguous between the following methods or properties:
'projectName.Pages.StringExt.Truncate(string, int, string)'
and
'projectName.Pages.StringExt.Truncate(string, int, string)'
Searched the app for this , but no duplicate methods found .
Yet the app runs fine and works when run from Visual Studio and Blazor Studio.
So it is something in the rendering of the pages and the visual editing part where Blazor Studio has some issues in this kind of situation?
I'm just trying again to see if my app can be transferred to Blazor Studio, so there is no blocking issue for me. Just sharing the experience.
I’ve installed the latest app build today (with .NET Core 9.0 support), but I’m still encountering the same issues.
I’d like to transition to the new Blazor Studio, but moving from Radzen Studio hasn’t been as smooth as I’d hoped. Despite several attempts, I’ve had no success running a real live app developed in Radzen Studio.
Do you have any additional tips or guidance? Does it make any difference if the app is on .Net 7.0 ?
Best regards,
Mehmet
Note: Even the "using Radzen" statement gets flagged as an error. However, "Run" executes the application without any issues. The problem lies specifically in editing the app with Radzen Blazor Studio.
@korchev
I’d like to clarify and provide more details to confirm that this issue specifically involves project references in RBS:
What I Did
Created a new application in RBS.
Scaffolding CRUD pages using the built-in tools.
Opened the generated solution in Visual Studio.
Added a project reference to another project to the solution.
Opened the solution again in RBS and added a using statement for the project reference in a .razor.cs file.
Observed Behavior
The application builds and runs correctly via dotnet run and using the blue "Run" button in RBS.
However, RBS fails to render the page in the designer, displaying:
"Application does not build. There is a build error which prevents this page from rendering."
The output window specifically shows:
"The referenced "Pain" could not be found (are you missing a using directive or an assembly?)"
This issue can be reproduced following the steps above. It appears that while project references are supported at runtime, they are not correctly recognized by RBS during the build step needed for page rendering.
Can you confirm if this is a known limitation, or if there’s an additional configuration required to make project references work in RBS?
I did try and couldn't reproduce it. The problem seems to be relate to your particular setup and this is why I am asking for the actual files to test it. If you can't provide them we won't be able to assist any further.
The problem is the target framework of the referenced project - netstandard2.0. Changing it to a supported version e.g. net8.0 solves the problem and the app opens as expected.
Thank you for the clarification!
So, to confirm, the limitation is that for RBS to render the app correctly, all referenced project dependencies must have the same target framework?
It seems this isn’t a requirement when using Visual Studio or running the app with "dotnet run". That was my confusion I think.