C
C#•4mo ago
big very sad man

DLL Dependencies Error

I wrote a custom DLL with Visual Studio in C# that I now plan to use in Unity. It contains Windows functions related to Bluetooth and Enumeration. These functions were imported in the class library that compiled the Dll via "Add References" option in VS. I wrote a file in Unity (test.cs) to access static functions in the file. I repeatedly get the error:
FileNotFoundException: Could not load file or assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
test.Start () (at Assets/test.cs:19)
FileNotFoundException: Could not load file or assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
test.Start () (at Assets/test.cs:19)
It's peculiar because the entire system appears fine until you click the red button: no unity editor errors, no red lines under any test. When run, it always reports this error. I know it's not a code issue - I wrote a Unit Test in Visual Studio and it worked perfectly. I know it's not a file issue - I compiled another function without Windows APIs in another static file within the same Dll/Class Library, and it works perfectly when Unity accesses its functions. In Unity, Assets/Plugins contains the custom DLL I'm using, System.Runtime.dll, Windows.winmd, Windows.Devices.Bluetooth.dll, and WIndows.Devices.Enumeration.dll. The file I'm using to test it (test.cs) is in the Assets folder. I am using .NET Framework 4.7.2 Class Library to compile the Dll in Visual Studio, Unity 2022.319f1 with VS as its editor (which reports zero errors when viewed), and a Windows 11 OS Lenovo computer. Unity compatibility settings are Mono, and .NET Framework. How do I resolve this? Any help would be appreciated! --- I'd love to use commands from them directly, but the issue is that I need to use classes from the Windows.Devices.Enumeration namespace so I can't import just static functions like DllImport lets me. If there's a solution to this that lets me import the class, I'd gladly use it! Looking for anything that resolves or sidesteps this problem RN. (I am trying to use Windows.Devices.Enumeration.DeviceWatcher class)
100 Replies
big very sad man
big very sad manOP•4mo ago
Thanks for your help! unfortunately I am not building to UWP (I want this code to work in Editor) and that's why I'm using a DLL. Do you have another solution?
reflectronic
reflectronic•4mo ago
hm, well what you would need to do is use https://github.com/microsoft/CsWinRT/blob/master/docs/embedded.md to reference the Windows APIs instead of referencing the Windows.winmd directly
big very sad man
big very sad manOP•4mo ago
This looks like it might work! How do I use it though? The file breaks whether I use NuGet for Unity or just manually unzip and add it
reflectronic
reflectronic•4mo ago
no, you should use that with the class library that you already had in visual studio
big very sad man
big very sad manOP•4mo ago
ohh i see
reflectronic
reflectronic•4mo ago
the package is setting up a bunch of stuff to automatically generate the glue code for the Windows API, it is not going to work if you just unpack it
big very sad man
big very sad manOP•4mo ago
it broke my code and said that windows could not be found I imported with VS. built in Nuget manager
reflectronic
reflectronic•4mo ago
you need to do that and then you need to set all of the properties it says on the page in the project file the CsWinRTEmbedded, CsWinRTWindowsMetadata, CsWinRTIncludes, etc. i would start by taking your whole csproj file and opening it in notepad and replacing it with this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<LangVersion>12</LangVersion>
<CsWinRTEmbedded>true</CsWinRTEmbedded>
<CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.8" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

<PropertyGroup>
<CsWinRTIncludes>
Windows.Devices.Enumeration;
</CsWinRTIncludes>
</PropertyGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<LangVersion>12</LangVersion>
<CsWinRTEmbedded>true</CsWinRTEmbedded>
<CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.8" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

<PropertyGroup>
<CsWinRTIncludes>
Windows.Devices.Enumeration;
</CsWinRTIncludes>
</PropertyGroup>

</Project>
yes, replace the entire thing
big very sad man
big very sad manOP•4mo ago
did this, it says that netstandard 2.0 is not available and same error (windows could not be found) do I remove the netstandard 2.0 file?
reflectronic
reflectronic•4mo ago
what do you mean by netstandard2.0 is not available
big very sad man
big very sad manOP•4mo ago
No description
reflectronic
reflectronic•4mo ago
can you show what your project file looks like now
big very sad man
big very sad manOP•4mo ago
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0-windows;net5.0-windows;netstandard2.0</TargetFrameworks>
<Platforms>x64;x86</Platforms>
</PropertyGroup>

<PropertyGroup>
<LangVersion>9</LangVersion>
<CsWinRTEmbedded>true</CsWinRTEmbedded>
<CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="$(CsWinRTVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\path\CppwinrtComponent\CppwinrtComponent.vcxproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Runtime.Extensions" Version="4.3.1" />
</ItemGroup>

<PropertyGroup>
<CsWinRTIncludes>
CppwinrtComponent;
Windows.Devices.Geolocation;
Windows.Foundation;
</CsWinRTIncludes>
</PropertyGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0-windows;net5.0-windows;netstandard2.0</TargetFrameworks>
<Platforms>x64;x86</Platforms>
</PropertyGroup>

<PropertyGroup>
<LangVersion>9</LangVersion>
<CsWinRTEmbedded>true</CsWinRTEmbedded>
<CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="$(CsWinRTVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\path\CppwinrtComponent\CppwinrtComponent.vcxproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.4" />
<PackageReference Include="System.Runtime.Extensions" Version="4.3.1" />
</ItemGroup>

<PropertyGroup>
<CsWinRTIncludes>
CppwinrtComponent;
Windows.Devices.Geolocation;
Windows.Foundation;
</CsWinRTIncludes>
</PropertyGroup>

</Project>
@reflectronic o oops i copied the wrong one
reflectronic
reflectronic•4mo ago
can you use the one i pasted instead
big very sad man
big very sad manOP•4mo ago
yeah sorry
big very sad man
big very sad manOP•4mo ago
No description
big very sad man
big very sad manOP•4mo ago
Seems like the only working namespace is Windows.Foundation.Collections
reflectronic
reflectronic•4mo ago
you will need to change the CsWinRTIncludes to add these namespaces (you can do it directly from visual studio by clicking on the project in solution explorer, you don't have to use notepad anymore)
big very sad man
big very sad manOP•4mo ago
yep the second erroring line is windows.devices.enumeration though and it doensnt work
reflectronic
reflectronic•4mo ago
when you build the project, what kind of errors does it give you
big very sad man
big very sad manOP•4mo ago
56 errors
big very sad man
big very sad manOP•4mo ago
No description
big very sad man
big very sad manOP•4mo ago
No description
big very sad man
big very sad manOP•4mo ago
No description
reflectronic
reflectronic•4mo ago
ok, you will have to delete your AssemblyInfo.cs file
big very sad man
big very sad manOP•4mo ago
just did now I have 2 warnings and 50 errors
big very sad man
big very sad manOP•4mo ago
still some of this
No description
big very sad man
big very sad manOP•4mo ago
No description
reflectronic
reflectronic•4mo ago
ok, so, can you try remove
<CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata>
<CsWinRTWindowsMetadata>10.0.19041.0</CsWinRTWindowsMetadata>
add
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.2" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.2" />
next to the other PackageReference items and try building again
big very sad man
big very sad manOP•4mo ago
same errors, but now with 59 warnings too
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<LangVersion>12</LangVersion>
<CsWinRTEmbedded>true</CsWinRTEmbedded>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.8" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.2" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

<PropertyGroup>
<CsWinRTIncludes>
Windows.System;
Windows.Devices.Enumeration;
Windows.UI.Core;
Windows.Devices.Bluetooth;
</CsWinRTIncludes>
</PropertyGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<LangVersion>12</LangVersion>
<CsWinRTEmbedded>true</CsWinRTEmbedded>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.8" />
<PackageReference Include="System.Memory" Version="4.5.5" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.2" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

<PropertyGroup>
<CsWinRTIncludes>
Windows.System;
Windows.Devices.Enumeration;
Windows.UI.Core;
Windows.Devices.Bluetooth;
</CsWinRTIncludes>
</PropertyGroup>

</Project>
project file
reflectronic
reflectronic•4mo ago
can you paste all of the errors and warnings, you should be able to copy them from the error list window
big very sad man
big very sad manOP•4mo ago
@reflectronic rereading the link you sent first, it seems that langversion must be set to 9. let me try that
reflectronic
reflectronic•4mo ago
no, that is not the cause of the issue
big very sad man
big very sad manOP•4mo ago
yeah didn't fix it also says "CsWinRTWindowsMetadata - must be set to the Windows SDK release to use for Windows APIs" I seem to have found it just re-checked the windows version I had it wasn't 10.0.19401.0 it was 10.0.22621.0 changing it makes there be no errors before building, but now it spits out about 5000 errors after building
reflectronic
reflectronic•4mo ago
if that works can you delete the
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.2" />
<PackageReference Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.2" />
big very sad man
big very sad manOP•4mo ago
I did, still 5000 errors
reflectronic
reflectronic•4mo ago
what are the errors
big very sad man
big very sad manOP•4mo ago
thing is though I don't have system.memory i don't think wait nvm i do
reflectronic
reflectronic•4mo ago
it seems like the problem is just adding the rest of the includes from the thing you just sent, you need to add Windows.UI; Windows.ApplicationModel; Windows.Storage.Streams; Windows.Foundation;
big very sad man
big very sad manOP•4mo ago
trying to rebuild rn it is taking way longer also curiously, the code highlights for API is now gone failed with 2k errors
big very sad man
big very sad manOP•4mo ago
No description
big very sad man
big very sad manOP•4mo ago
it does appear that I need windows.ui and windows.foundation, not sure about the other 2. ill do a bit of testing with them
big very sad man
big very sad manOP•4mo ago
OK the least errors I have is when I delete the middle 2 and change Windows.UI to Windows.UI.Core
reflectronic
reflectronic•4mo ago
delete Windows.System, add Windows.UI.Color
big very sad man
big very sad manOP•4mo ago
less errors
big very sad man
big very sad manOP•4mo ago
text highlights are back too
No description
reflectronic
reflectronic•4mo ago
ok this is going to be a very time consuming process
big very sad man
big very sad manOP•4mo ago
im ready
reflectronic
reflectronic•4mo ago
here is perhaps a better alternative:
big very sad man
big very sad manOP•4mo ago
sure, i'd love to hear it!
reflectronic
reflectronic•4mo ago
replace <CsWinRTIncludes> with
<CsWinRTFilters>
-include Windows
# Exclude Windows.UI, Windows.UI.Text, Windows.UI.Xaml per Microsoft.Windows.SDK.WinUI.Contracts NuGet
-include Windows.UI.Popups
-exclude Windows.UI.Colors
-exclude Windows.UI.IColors
-exclude Windows.UI.ColorHelper
-exclude Windows.UI.IColorHelper
#-exclude Windows.UI.Text (must include Windows.UI.Text to work around WinUI nuget issues)
-exclude Windows.UI.Xaml
-exclude Windows.ApplicationModel.Store.Preview
# Allow Windows.UI.Text, Windows.UI.Xaml types used in other namespaces
-include Windows.UI.Text.FontStretch
-include Windows.UI.Text.FontStyle
-include Windows.UI.Text.FontWeight
-include Windows.UI.Text.UnderlineType
-include Windows.UI.Xaml.Media.Animation.ConditionallyIndependentlyAnimatableAttribute
</CsWinRTFilters>
<CsWinRTFilters>
-include Windows
# Exclude Windows.UI, Windows.UI.Text, Windows.UI.Xaml per Microsoft.Windows.SDK.WinUI.Contracts NuGet
-include Windows.UI.Popups
-exclude Windows.UI.Colors
-exclude Windows.UI.IColors
-exclude Windows.UI.ColorHelper
-exclude Windows.UI.IColorHelper
#-exclude Windows.UI.Text (must include Windows.UI.Text to work around WinUI nuget issues)
-exclude Windows.UI.Xaml
-exclude Windows.ApplicationModel.Store.Preview
# Allow Windows.UI.Text, Windows.UI.Xaml types used in other namespaces
-include Windows.UI.Text.FontStretch
-include Windows.UI.Text.FontStyle
-include Windows.UI.Text.FontWeight
-include Windows.UI.Text.UnderlineType
-include Windows.UI.Xaml.Media.Animation.ConditionallyIndependentlyAnimatableAttribute
</CsWinRTFilters>
it is probably going to take a long time to build
big very sad man
big very sad manOP•4mo ago
also not sure, but ive just updated it with unloading + reloading the project is that what I'm supposed to be doing?
reflectronic
reflectronic•4mo ago
you should not need to reload it after you edit it
big very sad man
big very sad manOP•4mo ago
huh ok one error Severity Code Description Project File Line Suppression State Details Error (active) CS1029 #error: 'Unsupported Universal API Contract version' XDTKDllNet C:\Users\rli\source\repos\XDTKDllNet\XDTKDllNet\obj\Debug\net472\Generated Files\CsWinRT\ComInteropHelpers.cs 53 @reflectronic I assume I add -include Windows.Foundation.UniversalApiContract
reflectronic
reflectronic•4mo ago
add
<PropertyGroup>
<DefineConstants>$(DefineConstants);UAC_VERSION_15</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<DefineConstants>$(DefineConstants);UAC_VERSION_15</DefineConstants>
</PropertyGroup>
big very sad man
big very sad manOP•4mo ago
just hit run, the app froze visual studio oh its back
big very sad man
big very sad manOP•4mo ago
errors just complain about UI again
reflectronic
reflectronic•4mo ago
-exclude Windows.Foundation.PropertyType
big very sad man
big very sad manOP•4mo ago
Severity Code Description Project File Line Suppression State Details Warning (active) CS1998 This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread. XDTKDllNet C:\Users\rli\source\repos\XDTKDllNet\XDTKDllNet\Test.cs 27
Error (active) CS1029 #error: 'Unsupported Universal API Contract version' XDTKDllNet C:\Users\rli\source\repos\XDTKDllNet\XDTKDllNet\obj\Debug\net472\Generated Files\CsWinRT\ComInteropHelpers.cs 53
Warning (active) CS4014 The current method calls an async method that returns a Task or a Task<TResult> and doesn't apply the await operator to the result. The call to the async method starts an asynchronous task. However, because no await operator is applied, the program continues without waiting for the task to complete. In most cases, that behavior isn't what you expect. Usually other aspects of the calling method depend on the results of the call or, minimally, the called method is expected to complete before you return from the method that contains the call. An equally important issue is what happens to exceptions that are raised in the called async method. An exception that's raised in a method that returns a Task or Task<TResult> is stored in the returned task. If you don't await the task or explicitly check for exceptions, the exception is lost. If you await the task, its exception is rethrown. As a best practice, you should always await the call. You should consider suppressing the warning only if you're sure that you don't want to wait for the asynchronous call to complete and that the called method won't raise any exceptions. In that case, you can suppress the warning by assigning the task result of the call to a variable. XDTKDllNet C:\Users\rli\source\repos\XDTKDllNet\XDTKDllNet\Test.cs 29 same error as before
reflectronic
reflectronic•4mo ago
did you delete the DefineConstants? it should still be there
big very sad man
big very sad manOP•4mo ago
oops, let me put that back
big very sad man
big very sad manOP•4mo ago
19 errors
reflectronic
reflectronic•4mo ago
what happens if you -include Windows.UI.Text.FontWeights
big very sad man
big very sad manOP•4mo ago
its mostly still complaining about the UI assignments The error messages say IFontWeights, are you sure it's FontWeights?
reflectronic
reflectronic•4mo ago
yes
big very sad man
big very sad manOP•4mo ago
ok
big very sad man
big very sad manOP•4mo ago
similar errors with ifontweights
reflectronic
reflectronic•4mo ago
can you show your project file
big very sad man
big very sad manOP•4mo ago
it says uh
big very sad man
big very sad manOP•4mo ago
No description
big very sad man
big very sad manOP•4mo ago
let me friend you still doesn't work
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<LangVersion>9</LangVersion>
<CsWinRTEmbedded>true</CsWinRTEmbedded>
<CsWinRTWindowsMetadata>10.0.22621.0</CsWinRTWindowsMetadata>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.8" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);UAC_VERSION_15</DefineConstants>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<PropertyGroup>
<LangVersion>9</LangVersion>
<CsWinRTEmbedded>true</CsWinRTEmbedded>
<CsWinRTWindowsMetadata>10.0.22621.0</CsWinRTWindowsMetadata>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.8" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);UAC_VERSION_15</DefineConstants>
</PropertyGroup>
reflectronic
reflectronic•4mo ago
uh can you just send the CsWinRTFilters part
big very sad man
big very sad manOP•4mo ago
<PropertyGroup>
<!--<CsWinRTIncludes>
CppwinrtComponent;
Windows.Devices.Enumeration;
Windows.Devices.Bluetooth;
Windows.Foundation;
</CsWinRTIncludes>-->
<CsWinRTFilters>
-include Windows
# Exclude Windows.UI, Windows.UI.Text, Windows.UI.Xaml per Microsoft.Windows.SDK.WinUI.Contracts NuGet
-include Windows.UI.Popups
-exclude Windows.UI.Colors
-exclude Windows.UI.IColors
-exclude Windows.UI.ColorHelper
-exclude Windows.UI.IColorHelper
-exclude Windows.Foundation.PropertyType
#-exclude Windows.UI.Text (must include Windows.UI.Text to work around WinUI nuget issues)
-exclude Windows.UI.Xaml
-exclude Windows.ApplicationModel.Store.Preview
# Allow Windows.UI.Text, Windows.UI.Xaml types used in other namespaces
-include Windows.UI.Text.FontStretch
-include Windows.UI.Text.FontStyle
-include Windows.UI.Text.FontWeight
-include Windows.UI.Text.UnderlineType
-include Windows.UI.Text.Core
-include Windows.UI.Text.IFontWeights
-include Windows.UI.Text.IFontWeightsStatics
-include Windows.UI.Xaml.Media.Animation.ConditionallyIndependentlyAnimatableAttribute
</CsWinRTFilters>
</PropertyGroup>

</Project>
<PropertyGroup>
<!--<CsWinRTIncludes>
CppwinrtComponent;
Windows.Devices.Enumeration;
Windows.Devices.Bluetooth;
Windows.Foundation;
</CsWinRTIncludes>-->
<CsWinRTFilters>
-include Windows
# Exclude Windows.UI, Windows.UI.Text, Windows.UI.Xaml per Microsoft.Windows.SDK.WinUI.Contracts NuGet
-include Windows.UI.Popups
-exclude Windows.UI.Colors
-exclude Windows.UI.IColors
-exclude Windows.UI.ColorHelper
-exclude Windows.UI.IColorHelper
-exclude Windows.Foundation.PropertyType
#-exclude Windows.UI.Text (must include Windows.UI.Text to work around WinUI nuget issues)
-exclude Windows.UI.Xaml
-exclude Windows.ApplicationModel.Store.Preview
# Allow Windows.UI.Text, Windows.UI.Xaml types used in other namespaces
-include Windows.UI.Text.FontStretch
-include Windows.UI.Text.FontStyle
-include Windows.UI.Text.FontWeight
-include Windows.UI.Text.UnderlineType
-include Windows.UI.Text.Core
-include Windows.UI.Text.IFontWeights
-include Windows.UI.Text.IFontWeightsStatics
-include Windows.UI.Xaml.Media.Animation.ConditionallyIndependentlyAnimatableAttribute
</CsWinRTFilters>
</PropertyGroup>

</Project>
ok i sent it in 2 parts this seems to work sorry about that
reflectronic
reflectronic•4mo ago
can you remove the # from -exclude Windows.UI.Text or, uh delete the whole line and replace it with -exclude Windows.UI.Text
big very sad man
big very sad manOP•4mo ago
OK IT HAS NO ERRORS!
big very sad man
big very sad manOP•4mo ago
14 warnings though let me try that with my Unit test
reflectronic
reflectronic•4mo ago
yeah that's fine it is probably very slow to build even if you make a small change to your own code it will probably be very slow
big very sad man
big very sad manOP•4mo ago
nah like 1 minute
reflectronic
reflectronic•4mo ago
i would suggest extracting your own code into a separate project leave the generated code in its own project, and add a reference to it from the new project, so that it does not get rebuilt every time you tweak something
big very sad man
big very sad manOP•4mo ago
OK I see
reflectronic
reflectronic•4mo ago
but this should work for unity now
big very sad man
big very sad manOP•4mo ago
let me test that rq it does work for my VS unit test Sorry, tested the wrong version. Not sure it works yet IT WORK IN VS No, unfortunately it says this: Assembly 'Assets/Plugins/XDTKDllNet.dll' will not be loaded due to errors: Unable to resolve reference 'System.Runtime.CompilerServices.Unsafe'. Is the assembly missing or incompatible with the current platform? Reference validation can be disabled in the Plugin Inspector.
reflectronic
reflectronic•4mo ago
you will have to load System.Runtime.CompilerServices.Unsafe as well
reflectronic
reflectronic•4mo ago
System.Runtime.CompilerServices.Unsafe 6.0.0
Provides the System.Runtime.CompilerServices.Unsafe class, which provides generic, low-level functionality for manipulating pointers. Commonly Used Types: System.Runtime.CompilerServices.Unsafe
reflectronic
reflectronic•4mo ago
press "open in NuGet Package Explorer", open lib/net461, double click on the DLL to download it
big very sad man
big very sad manOP•4mo ago
into VS DLL or into Unity?
reflectronic
reflectronic•4mo ago
into unity
big very sad man
big very sad manOP•4mo ago
I tried that, the editor application fully crashed after hitting run
reflectronic
reflectronic•4mo ago
hm
big very sad man
big very sad manOP•4mo ago
Crash Logs from Editor.Log
big very sad man
big very sad manOP•4mo ago
I am currently running it from file being in the project though maybe I can fix it by just making that work not sure though error is a bit convoluted language
reflectronic
reflectronic•4mo ago
i am not really sure how to fix this well, i don't even know what's causing it
big very sad man
big very sad manOP•4mo ago
yeah same let me see if Unity discord knows how it is pretty late for me though so maybe I'll try again in 1 or 2 days regardless, thank you so so much for helping me with this project have a good day!
Want results from more Discord servers?
Add your server