Robmaister / SharpFont

Cross-platform FreeType bindings for .NET - Need maintainer
Other
294 stars 107 forks source link

Cannot install 64bit dependencies #113

Open ghidosoft opened 7 years ago

ghidosoft commented 7 years ago

I installed SharpFont using the nuget package but the deployed freetype6.dll is always 32bit. When I switch the platform of my solution to x64 I get this exception:

Unhandled Exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at SharpFont.FT.FT_Init_FreeType(IntPtr& alibrary) at SharpFont.Library..ctor() ...

Am I missing something? Thanks.

fls-eugene commented 7 years ago

Getting same results from nugget.

JibbSmart commented 7 years ago

I had this problem and worked around it by editing SharpFont.Dependencies.props -- the Include line references an x86 folder, and you can change it to x64 to get the right DLL. This has worked so far in development, anyway.

wstaelens commented 6 years ago

same problem.... 😞

s2quake commented 4 years ago

I found a code to solve the problem.

 <ItemGroup>
   <PackageReference Include="SharpFont.Dependencies" Version="2.6.0" GeneratePathProperty="true" />
 </ItemGroup>
 <ItemGroup>
   <Content Update="$(PkgSharpFont_Dependencies)\bin\msvc10\x86\freetype6.dll">
     <CopyToOutputDirectory>Never</CopyToOutputDirectory>
   </Content>
   <Content Include="$(PkgSharpFont_Dependencies)\bin\msvc10\x64\freetype6.dll">
     <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
   </Content>
 </ItemGroup>

The test environment is dotnet core 3.1.