peterh
Topic Author
Posts: 39
Joined: 13 Mar 2015, 13:50

[C# SDK] Default xmlns does not work in Visual Studio

17 May 2023, 10:03

I'm experimenting with the C# SDK, and created a new project using the template provided by the extension.

VS can't seem to find the controls from the default namespace, making editing XAML in VS a pain.
<Application x:Class="EasyLaser.XT.App.Noesis.App"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="clr-namespace:EasyLaser.XT.App.Noesis"
  StartupUri="MainWindow.xaml">
The compiler shows the error:
The type 'Application' was not found. Verify that you are not missing an assembly reference and that all referenced assemblies have been built.
This also leads to intellisense not working correctly which prevents NoesisApp from being a viable alternative for me compared to e.g. MAUI or Avalonia when developing non-Unity apps.
 
User avatar
maherne
Site Admin
Posts: 41
Joined: 01 Jul 2022, 10:10

Re: [C# SDK] Default xmlns does not work in Visual Studio

17 May 2023, 16:41

In order to edit XAML files in a Visual Studio project, without showing errors, it must be a WPF project.

XAML files cannot be edited in Noesis projects as no WPF types are available, leading to the errors you are seeing.

Solutions generated using our C# App template contain a blend WPF project with which you can edit your XAML files.

All of the projects in our template recursively link to XAML and asset files in the Src folder, changes to XAML and assets files are shared in all projects.
 
peterh
Topic Author
Posts: 39
Joined: 13 Mar 2015, 13:50

Re: [C# SDK] Default xmlns does not work in Visual Studio

23 May 2023, 15:16

This raises more questions than answers for me. What is the intended workflow with the project structure in your templates? E.g. adding a new file when opening the blend project will not place that file in the Src folder? Why do you forego the normal C# project structure with project references and the like for this approach?
 
User avatar
maherne
Site Admin
Posts: 41
Joined: 01 Jul 2022, 10:10

Re: [C# SDK] Default xmlns does not work in Visual Studio

23 May 2023, 21:25

The template was based on the workflow we use for our samples, which is to manually manage the XAML and assets in a Src folder.

I see now though that this is less than ideal for those who want to manage these elements in a Visual Studio project. I think the best solution would be to update NoesisGUI C# Project Templates so that the Blend project is in the Src folder. This way the Blend project is the authoritative project, and any changes to it will be reflected in the Noesis platform projects.
With this change the workflow would be to create and edit XAML files and classes in the Blend project, and then use the Noesis platform projects to build for various platforms.

Would you report a new issue on our bug tracker for this change? You can then use that issue to track the progress of the update.

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 101 guests