I already read that documentation before posting in the forum and I tried many different configurations because I was getting errors for every single try. For instance, if I insert this configuration which actually is the config that makes most sense to me, it still fails:
I am gonna leave here a ZIP file with the project just in case anyone wants to have a look at it and can provide another point of view after running the solution.
I just checked BimorphNodes and…I’m not doing what I suggested at all! In fact, I’m still able to use the old framework target for building the customization assembly.
This compiles and loads correctly in Revit 2025. I’m targeting .NET 8 before you ask. <GetReferenceAssemblyPaths TargetFrameworkMoniker=".NETFramework, Version=v4.8">
Ok I didn’t realise you were still targeting .NET 4.8.
Your problem isn’t here, its actually your TargetFrameworkVersion property value in your Project properties. It should be: <TargetFrameworkVersion>net48</TargetFrameworkVersion>
Also, you’re using the old style VS templates which are pretty bad compared to the latest ones. You can upgrade your projects, but I’ve always found this to be a pain, so what I do is simply create a new project using the latest .NET version (8), drag/drop all your folders from the old project into the new one, then you can make it backwards compatible with NET 4.8 like this:
I tried this approach same as BimorphNodes, targeting NET8 but building the customization assembly with <GetReferenceAssemblyPaths TargetFrameworkMoniker=".NETFramework, Version=v4.8"> but when I open DynamoSandbox and I try to insert the node (sayHello), it gets stuck and the software does nothing and shows up this error:
@Thomas_Mahon I think you got confused reading an older reply with another sample that I tried for .NET Framework targetin 4.8. For that sample everything worked just fine.
Currently, I am trying to do the same but targeting .NET8.0 and it is where I am coming across with some issues such as the creation of the customization assembly.
I’m working on this now for a package and just found out that adding images in VisualStudio 2022 with the new SDK style of project does not add them as Base64. So “embedded in resx” is not an option. If I convert to base64 myself, edit the resx manually, the images work.
Is there a setting that tells visual studio to use images as base64?
I went ahead and just made a .resx generator in Rhythm. I will publish it soon. It takes an input directory and creates the .resx for you based on all the pngs within it.
The fact that this is still an issue and the documentation is six years old is ridiculous. I removed images from Rhythm back when 2.13 dropped because the node library icons went away for the top-level icon, and I figured why bother because I just used one icon for the whole package.
Looking forward to your publication to see how you sort the issue out, @john_pierson. Thank you for everything you do for the community.
Although it worked for me the addition of icons with new SDK style and NET4.8 (video attached above), I spent my whole weekend trying to troubleshoot why the icons were not added when targeting NET8.0 with no success… I swear I cannot remember how many different configurations I tried… my next try was gonna be reinstall VS 2022 and NET8 lol.
Yeah that is what is frustrating the heck out of me. So, this node will be in Rhythm shortly. Basically you just input your directory of Large and Small icons, the desired path for the .resx file and it will shoot it out for you with them all encoded as base64.
I managed to make my solution multi-framework and generate the Nodes Icons correctly.
Below is what I have done.
IMPORTANT:
Dynamo needs a satellite Assembly to generate the nodes’ icons.
Two things were messing up to achieve this in the SDK Style csproj required by .net8
The satellite DLL needs to be generated from a binary .resources file instead of a .resx file. To achieve this, according to the Dynamo documentation, it is necessary to use the <GenerateResource> Task.
This Task calls a tool named ResGen.exe in the background to compile the .resx into .resources.
The compilation of the satellite DLL was also getting messed up because the Dynamo documentation directs to use the <AL> (Assembly Linker) Task, but this only works in .NetFramework.
In .net8, it’s necessary to use the C# compiler itself, with the <Csc> Task.
So here’s what I did to resolve each issue:
I eliminated everything that was calling ResGen.exe to compile the .resources. Instead, now I use the terminal with resgen command to compile .resources file
In Visual Studio you need to call regen command in terminal manually.
Oh, one last thing.
With the implementation of this SDK Style for the csproj, many Windows-specific elements are no longer in the SDK, due to this cross-platform approach. So, to create resources in .net framework 4.8, it requires installing the package: