View Issue Details

IDProjectCategoryView StatusLast Update
0002041NoesisGUIUnitypublic2021-06-09 19:17
Reportersfernandez Assigned Tosfernandez  
PrioritynormalSeverityfeature 
Status assignedResolutionopen 
Product Version3.0.12 
Target Version3.1 
Summary0002041: Create Blend project from existing Unity project
Description

Add a menu entry in our Noesis menu to generate a Blend project from an existing Unity project.

Similar to Visual Studio project template this option should:

  • add the Noesis.GUI.Extension nuget reference
  • set up the folder structure
  • include all the xaml+cs and dependencies available inside Assets in the project
PlatformAny

Activities

KeldorKatarn

KeldorKatarn

2021-06-09 01:13

reporter   ~0007287

Last edited: 2021-06-09 01:20

This should be a new .NET Standard SDK project, not one of the old ones. Those are awkward.

It might also be beneficial to create a Directory.Build.props file at the project root so the bin and obj folders can be moved properly into the Blend directory.

A .NET Standard project can then be as simple as:

<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<LangVersion>8</LangVersion>
<TargetFramework>net472</TargetFramework>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<EnableDefaultPageItems>false</EnableDefaultPageItems>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
<EnableDefaultNoneItems>false</EnableDefaultNoneItems>
<OutputType>WinExe</OutputType>
<UseWPF>true</UseWPF>
<RootNamespace>UnityProjectNamespace</RootNamespace> <!-- Should be the same as Unity project so the namespaces for replacement ViewModels still match and Resharper doesn't complain about wrong namespaces -->
<AssemblyName>UnityProjectName.Blend</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2021.1.0" />
<PackageReference Include="Noesis.GUI.Extensions" Version="3.0.6" />
</ItemGroup>

<ItemGroup>
<Compile Include="Assets\Scripts**.xaml.cs" />
<Page Include="Assets\Scripts*
*.xaml" />
</ItemGroup>

<ItemGroup>
<Compile Include="Blend**.cs" />
<Page Include="Blend*
*.xaml" />
</ItemGroup>

<ItemGroup>
<ApplicationDefinition Include="Blend\App.xaml" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Blend*\obj**." />
<Page Remove="Blend*
\obj**." />
</ItemGroup>

</Project>

Maybe also include font and image files or such.

jsantos

jsantos

2021-06-09 14:32

manager   ~0007288

Thank you for this, let's see if we can have something ready for 3.1, will Blend open this new .NET Standard SDK project ?

KeldorKatarn

KeldorKatarn

2021-06-09 19:08

reporter   ~0007289

Last edited: 2021-06-09 19:11

Blend for Visual Studio does yes :) I can even edit the project file in there.
This new project file type is WAY better. It supports hotloading, i.e. it detects when a new file was added. So if I add a relevant class in Rider or VS or Unity or wherever to my Unity Project, the Blend project will automatically pick it up
if it matches one of those include filters.
Usually you just put these projects at the root and they just include eveything, that's why they need hot loading anyway, because any file added by VS isn't actually added to the project file anymore. That's why the project files can be so slim.
In our case we don't want everything included so I deactivated the default includes and just include certain search patterns. But those patterns will pick up any new file. This is INSANELY more efficient in this workflow with Noesis.

KeldorKatarn

KeldorKatarn

2021-06-09 19:15

reporter   ~0007290

Last edited: 2021-06-09 19:17

Also here's my Directory.Build.props at the project root: (This makes sure the obj and bin folders are properly moved. BaseIntermediateOutputPath cannot be set in the project itself since NuGet and other stuff needs to know about that before reading the project file property group, so those things end up in the right place. - Well it CAN be set but VS will throw a warning for that reason)

<Project>
<PropertyGroup>
<OutputPath>Blend/bin</OutputPath>
<BaseIntermediateOutputPath>Blend/obj</BaseIntermediateOutputPath>
<MSBuildProjectExtensionsPath>Blend/obj/$(MSBuildProjectName)</MSBuildProjectExtensionsPath>
<RestoreOutputPath>Blend/obj/$(MSBuildProjectName)</RestoreOutputPath>
</PropertyGroup>
</Project>

I also found a way to have the blend projects themselves in the Blend folder, since you can also automatically link files and even give them the proper base path, which works fine.
However it messes with Resharper's ability to detect correct Resource paths and right-click add item does not allow adding UserControls in those linked paths.
I'll investigate further if that can be done somehow.

Issue History

Date Modified Username Field Change
2021-06-04 16:48 sfernandez New Issue
2021-06-04 16:48 sfernandez Assigned To => sfernandez
2021-06-04 16:48 sfernandez Status new => assigned
2021-06-04 16:48 sfernandez Target Version => 3.1
2021-06-09 01:13 KeldorKatarn Note Added: 0007287
2021-06-09 01:19 KeldorKatarn Note Edited: 0007287
2021-06-09 01:20 KeldorKatarn Note Edited: 0007287
2021-06-09 14:32 jsantos Note Added: 0007288
2021-06-09 19:08 KeldorKatarn Note Added: 0007289
2021-06-09 19:11 KeldorKatarn Note Edited: 0007289
2021-06-09 19:15 KeldorKatarn Note Added: 0007290
2021-06-09 19:15 KeldorKatarn Note Edited: 0007290
2021-06-09 19:17 KeldorKatarn Note Edited: 0007290
2025-10-10 13:29 jsantos Category Unity3D => Unity