Steamworks.NET icon indicating copy to clipboard operation
Steamworks.NET copied to clipboard

I find a problem about add the dll by myslef,not use nuget to add it.

Open shineforwu opened this issue 10 months ago • 7 comments

When I was creating a demo using Visual Studio 2022 with Steamworks.NET, and targeting the output for Windows x64. I manually added \Steamworks.NET-Standalone_2024.8.0\Windows-x64\Steamworks.NET.dll. Surprisingly, the dependency name it required was steam_api.dll instead of steam_api64.dll I solved the issue by renaming steam_api64 to steam_api. Simply replacing steam_api64.dll with steam_api.dll would result in an error.


  <ItemGroup>
<!--    this is    \Steamworks.NET-Standalone_2024.8.0\Windows-x64\Steamworks.NET.dll. -->    
    <Reference Include="Steamworks.NET">
      <HintPath>Steamworks.NET.dll</HintPath>
                
    </Reference>
  </ItemGroup>


  <ItemGroup>
<!--  Why  I need to  change the name ?     I used the dll  "steam_api64.dll   . If  I   don't change the name . It will tell not load steam_api   ,  so  i have try to change  the name . -->
    <None Update="steam_api.dll">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="steam_appid.txt">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
  </ItemGroup>

shineforwu avatar Mar 08 '25 15:03 shineforwu

Seems the the dll name of P/Invoke is misconfigured but marshalling is still correct in the building project. As for I know, project that building NuGet package(called Steamworks.NET.Standard.csproj) is good, try to reference that project or use package directly.

Akarinnnnn avatar Mar 11 '25 11:03 Akarinnnnn

Seems the the dll name of P/Invoke is misconfigured but marshalling is still correct in the building project. As for I know, project that building NuGet package(called Steamworks.NET.Standard.csproj) is good, try to reference that project or use package directly.

The DLL I'm using is from the Release 2024.8.0 package of Steamworks.NET. It's just that I didn't add it via the NuGet method. Instead, I added it by manually referencing the DLL. I try use the way of Guget is ok,But I want to use manually referencing the DLL. So I find the problem .

shineforwu avatar Mar 11 '25 13:03 shineforwu

After some investigation, you are using a version targeting to .NET Framework. The misconfigured project file caused this issue.

Akarinnnnn avatar Mar 11 '25 13:03 Akarinnnnn

I will try to figure out why a x64 binary has a x86 steam dll name.

Akarinnnnn avatar Mar 11 '25 13:03 Akarinnnnn

Sorry I can't help you, my .NET SDK refuse to build the framework project due to unable to restore NuGet package. See if zip publisher @rlabrecque will take a look.

Akarinnnnn avatar Mar 11 '25 13:03 Akarinnnnn

If you want to reference DLL directly, download NuGet package and unzip it is also a choice, it's just a zip file. Runtime specific DLLs are located in runtime/*/lib

Akarinnnnn avatar Mar 12 '25 02:03 Akarinnnnn

I will use godot-4.4.net to write a project,so i want to add the dll by

 <Reference Include="Steamworks.NET">
      <HintPath>Steamworks.NET.dll</HintPath>

shineforwu avatar Mar 12 '25 12:03 shineforwu