
Andrew Brink
2 discussion posts
Hello all, I am trying to make a script that when ran, displays the focused windows dimensions. I am a very basic programmer and most of my code involves copying others and making adjustments but I see that there is a function that would seem to do all of this - Rectangle[] bounds = BFS.Monitor.GetMonitorBounds(); and then display the 4 values with another line of code. All seems good however, that function brings up an error.
Line 0, Char 0, Assembly 'DisplayFusionScripting' with identity 'DisplayFusionScripting, Version=11.0.0.4, Culture=neutral, PublicKeyToken=null' uses 'System.Drawing.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxx' which has a higher version than referenced assembly 'System.Drawing.Primitives' with identity 'System.Drawing.Primitives, Version=4.2.1.0, Culture=neutral, PublicKeyToken=xxxxxxxxxxxxx'
I replaced the values of the publickeytokens with x's because I don't know if that information is sensitive or not. But I have attempted to update/ install .net and in cmd, --list-sdks =
5.0.408
8.0.300
9.0.203
I have tried to figure this out myself but came to the conclusion that my knowledge in this department isn't enough for me or chatgpt. I've reinstalled display fusion & I have the pro version if that matters. I have manually added system.drawing.primitives & system.drawing dll to the references for each sdk version
Any help on this would be appreciated! Code below is what I want/ need? to accomplish my original goal, can add all the displaying of bounds later once I first get this error fixed.
Code:
using System;
using System.Drawing;
public static class DisplayFusionFunction
{
public static void Run(IntPtr windowHandle)
{
Rectangle[] bounds = BFS.Monitor.GetMonitorBounds();
}
}

Andrew Brink
2 discussion posts
Solved, 5mins after this post, I saw a post mentioning to instal dotnet 8.0.15 and reboot.
On the plus side it now works, downside is I lost 8-9 hours of trying to solve this and a good amount of brain cells