SharpFont icon indicating copy to clipboard operation
SharpFont copied to clipboard

Cannot install 64bit dependencies

Open ghidosoft opened this issue 8 years ago • 4 comments

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.

ghidosoft avatar May 10 '17 19:05 ghidosoft

Getting same results from nugget.

fls-eugene avatar Jul 06 '17 15:07 fls-eugene

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.

JibbSmart avatar Sep 27 '17 07:09 JibbSmart

same problem.... 😞

wstaelens avatar Dec 20 '17 14:12 wstaelens

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.

s2quake avatar Mar 15 '20 02:03 s2quake