Code Monkey home page Code Monkey logo

Comments (22)

gabehxd avatar gabehxd commented on June 1, 2024

Though i'm not very found of how it was implemented from a quick glance I believe I could create a sort of "shared library" that both the CLI and GUI version can both use thus removing lots of possible code duplication and put it into 2 separate projects files, keeping it cleaner than putting it all into one project file.

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

If you would like to help start on that it would be much appreciated :) (do make sure to pr it as a draft too!)

from switchpresence-rewritten.

ioistired avatar ioistired commented on June 1, 2024

I'm not sure I'm adept enough at C# for that. This port was my first time working with the language.

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

CLI SwitchPresence
GUI SwitchPresence
:)

Please do test I have no clue if they work lol.

from switchpresence-rewritten.

ioistired avatar ioistired commented on June 1, 2024
➤ mono SwitchPresence-CLI.exe
Cannot open assembly 'SwitchPresence-CLI.exe': File does not contain a valid CIL image.
➤ file SwitchPresence-CLI.exe 
SwitchPresence-CLI.exe: PE32+ executable (console) x86-64, for MS Windows
➤ chmod +x SwitchPresence-CLI.exe 
➤ ./SwitchPresence-CLI.exe 
0026:fixme:msvcrt:_configure_wide_argv (1) stub
0026:fixme:msvcrt:_initialize_wide_environment stub
A fatal error occurred. The required library hostfxr.dll could not be found.
If this is a self-contained application, that library should exist in [Z:\home\user\Downloads\SwitchPresence-Client\].
If this is a framework-dependent application, install the runtime in the global location [C:\Program Files\dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x64\InstallLocation].
0026:fixme:advapi:RegisterEventSourceW ((null),L".NET Runtime"): stub
0026:fixme:advapi:ReportEventW (0xcafe4242,0x0001,0x0000,0x000003ff,(nil),0x0001,0x00000000,0x2afc90,(nil)): stub
0026:err:eventlog:ReportEventW L"Description: A .NET Core application failed.\nApplication: SwitchPresence-CLI.exe\nPath: Z:\\home\\user\\Downloads\\SwitchPresence-Client\\SwitchPresence-CLI.exe\nMessage: A fatal error occurred. The required library hostfxr.dll could not be found.\nIf this is a self-contained application"...
0026:fixme:advapi:DeregisterEventSource (0xcafe4242) stub

The one you gave me fails because it's not compiled for my platform. But compiling it myself works fine 👍

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

The application was built with DotNet core so try downloading that and running it with dotnet instead

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

i'll double check my compilation setting as well

from switchpresence-rewritten.

ioistired avatar ioistired commented on June 1, 2024

How do I "run it with dotnet"? dotnet build produces native executables for me. I have dotnet core installed, since it works for me when I compile it myself. I don't need to run my compiled copy with dotnet or anything, just the path to the executable.

from switchpresence-rewritten.

ioistired avatar ioistired commented on June 1, 2024

The command I used is env FrameworkPathOverride=/usr/lib/mono/4.7.2-api/ dotnet build. I am using Arch Linux.

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

ah my bad it should be a 'publish' version

from switchpresence-rewritten.

ioistired avatar ioistired commented on June 1, 2024

What does that mean?

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

VS allows you to compile it into two different ways one of them being a publish version which out a dll instead of an exe iirc

from switchpresence-rewritten.

ioistired avatar ioistired commented on June 1, 2024

So is that an error on your end or something I need to change?

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

you should be running the dll in the zip with dotnet run

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

My bad that actually might only be for windows, try this one instead
publish.zip

from switchpresence-rewritten.

ioistired avatar ioistired commented on June 1, 2024
/tmp/foo
➤ dotnet run SwitchPresence-CLI.dll
Couldn't find a project to run. Ensure a project exists in /tmp/foo, or pass the path to the project using --project.
/tmp/foo
➤ file SwitchPresence-CLI.exe
SwitchPresence-CLI.exe: PE32+ executable (console) x86-64, for MS Windows
/tmp/foo
➤ file SwitchPresence-CLI.dll
SwitchPresence-CLI.dll: PE32 executable (console) Intel 80386 Mono/.Net assembly, for MS Windows
/tmp/foo
➤ mono SwitchPresence-CLI.dll 

Unhandled Exception:
System.BadImageFormatException: Could not resolve field token 0x04000005, due to: Could not load type of field 'SwitchPresence_CLI.Program:timer' (0) due to: Could not resolve type with token 0100000d from typeref (expected class 'System.Timers.Timer' in assembly 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Timers.Timer member:(null) assembly:/tmp/foo/SwitchPresence-CLI.dll type:Program member:(null)
File name: 'SwitchPresence-CLI'
[ERROR] FATAL UNHANDLED EXCEPTION: System.BadImageFormatException: Could not resolve field token 0x04000005, due to: Could not load type of field 'SwitchPresence_CLI.Program:timer' (0) due to: Could not resolve type with token 0100000d from typeref (expected class 'System.Timers.Timer' in assembly 'System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') assembly:System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:System.Timers.Timer member:(null) assembly:/tmp/foo/SwitchPresence-CLI.dll type:Program member:(null)
File name: 'SwitchPresence-CLI'

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

my bad it should be "dotnet "

from switchpresence-rewritten.

ioistired avatar ioistired commented on June 1, 2024
/tmp/tmp.6WE5t5Gao2
➤ dotnet SwitchPresence-CLI.exe
Error:
  An assembly specified in the application dependencies manifest (SwitchPresence-CLI.deps.json) has already been found but with a different file extension:
    package: 'SwitchPresence-CLI', version: '1.0.0'
    path: 'SwitchPresence-CLI.dll'
    previously found assembly: '/tmp/tmp.6WE5t5Gao2/SwitchPresence-CLI.exe'

from switchpresence-rewritten.

ioistired avatar ioistired commented on June 1, 2024

oh wait my bad, dotnet SwitchPresence-CLI.dll seems to work

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

uh i think something is wrong on your end try clearing temp?

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

oh ok

from switchpresence-rewritten.

gabehxd avatar gabehxd commented on June 1, 2024

at it seems it functions i will be closing this issue and merging

from switchpresence-rewritten.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.