ScreenRecorderLib icon indicating copy to clipboard operation
ScreenRecorderLib copied to clipboard

Is there any way to target the platform to x64?

Open SID9-HoneyBee opened this issue 4 years ago • 9 comments

In order to take advantage of the other functions the program has, the system must make the most of its memory and CPU. In many aspects, I would like to set up my program to run in an x64 environment. Is there a way to use ScreenRecorderLib on x64?

SID9-HoneyBee avatar Feb 26 '21 01:02 SID9-HoneyBee

It should work with both x86 and x64, do you have any specific issues with compiling for x64?

sskodje avatar Feb 26 '21 02:02 sskodje

@sskodje Yes. I am currently developing in C# Wpf. I referenced Dll with Nuget Package.

Set the platform target to x64, compile it, then An error occurs when calling the function.

I think I heard a story somewhere that only x86 is possible. is not it?

image

System.BadImageFormatException: '파일이나 어셈블리 'ScreenRecorderLib, Version=1.0.7722.25750, Culture=neutral, PublicKeyToken=null' or One of the files or assemblies that depend on it cannot be loaded. An attempt was made to load the program in the wrong format.'

SID9-HoneyBee avatar Feb 26 '21 07:02 SID9-HoneyBee

I'm unable to reproduce this issue. Is it still broken if you create a new empty project, import the nuget package, set the platform target to x64, and create an instance of Recorder?

sskodje avatar Feb 26 '21 12:02 sskodje

You have created a new WPF C# project. (I am VS 2019.) If you create a project and reference ScreenRecorderLib in Nuget Package, It is not displayed normally in the reference list of the project. The installation was successful, but I can't see it in the reference. So inevitably you are referencing a DLL file.

SID9-HoneyBee avatar Feb 27 '21 06:02 SID9-HoneyBee

It's normal that it is not showing in the reference list, that is because it uses a .targets file in the nuget package to inject the proper DLL for your build.

sskodje avatar Feb 27 '21 10:02 sskodje

@SID9-HoneyBee The issue is probably with your system display settings. Check if you have the same settings? image

aqibbanday avatar Mar 02 '21 07:03 aqibbanday

Hi all,

I think I have a similar issue. I gathered ScreenRecorderLib from NuGet to my .Net6 project. I compiled it as x64 but when trying to run my project I get this:

C:\Users\i.recio\.nuget\packages\screenrecorderlib\3.1.2\build\ScreenRecorderLib.targets(6,5): error : ScreenRecorderLib does not work correctly on 'AnyCPU' platform. You need to specify platform (x86, Win32 or x64). [C:\Users\i.recio\source\repos\<MyProjectName>\<MyProjectName>\<MyProjectName>.csproj]

I am running dotnet test from PowerShell. Am I missing something?

Thanks a lot

igorrecioh avatar Jan 17 '22 09:01 igorrecioh

@igorrecioh how do you run your tests (exact command)? In my case, to publish my app from cmd line I need to setup platform to x64:

my pub.bat file:

SET Platform=x64 dotnet publish -c Release -r win10-x64

btw, just saw that you build the ScreenRecorderLib not an app using ScreenRecorderLib, sorry. But maybe it's the same as I was getting same error before SET Platform=x64.

lzwierko avatar Jan 17 '22 12:01 lzwierko

Hi @lzwierko!

I am using ScreenRecorderLib along with my tests using NUnit fw just to clarify my application =)

I am running:

dotnet test .\Expert.csproj --settings .\.runsettings

Will try that! Btw, I have skipped the issue by doing this --> https://stackoverflow.com/a/70739838/17953639 It's a dirty workaround but it works.. hehe.

Anyway, it works only for screenshots and slideshow options. I don't get any video, however the .mp4 file is created but it is empty (0 bytes)... Weird thing...

igorrecioh avatar Jan 17 '22 13:01 igorrecioh