-1

My code is built in NET Framework 4.7.2, it uses two .dlls siticone.dll + windowsinput.dll.

How do I let my code be used by others and include these .dlls. I am highly certain this is caused by those .dlls, as when I make a new WinForms app my friends can open that code but not my main one that has these .dlls!

P.S: on opening the code it sits in Task manager but does not physically open

James L
  • 19
  • 5
  • I use this method for NET 6 which you can try - the right method to compile your c# app is by going to the top where all tabs are located like Build. Hover your mouse on build on then at the bottom (https://ibb.co/mbNHMxc) then just publish locally. Backup method - switch to release mode and build your app. Then go where your app is located and build then go to bin/release/ and copy the folder . – Felierix Mar 18 '22 at 09:34
  • Do your program, or libraries, use any native dlls? A common reason for failing to start is missing vc runtime. This is included with visual studio, but needs to be installed separately on other machines. Also, check the event viewer, that may contain some errors about the application. – JonasH Mar 18 '22 at 09:50
  • Code only works on deploy machine when the same version of Net (and updates) are on both build and deployed machine. If Net is not exactly the same than you must publish application and install like commercial software using the setup.exe folder. Publish updates the windows dlls on deploy machine to match the dlls on the build machine. The Net library uses windows dlls and the windows dlls must be same on build and deployed machines. – jdweng Mar 18 '22 at 10:09
  • To reply to all First Techie! - Yes the two .dlls are in the BIN, when i sent them to my friend i included those two .dlls but nothing. To Felierix! - let me try that out and get back to you. To JonasH! - I am using Winapis, I'm using kernal and global keyboard hooks too. I had my friend install vcruntime already but nothing. I tried checking out errors but got nothing. To jdweng! - I tried using setup.exe but had no luck either, i also found it confusing and ugly to use. Im also a bit confused as to what you are saying these terms im not very familiar with – James L Mar 18 '22 at 10:48
  • Replying to jdweng: https://ibb.co/VQQTzsn - this is the link to what you told me to do, you can also right click on your "csproj" and click "publish" I have tried it and it comes up with this on my PC: https://ibb.co/82DpZMX . when I send it to my friend it comes up with errors. (sorry I didn't get a screenshot of the errors but if you believe it necessary I will) – James L Mar 18 '22 at 10:58
  • I would suggest creating a virtual machine so you can test if your program runs on a clean install yourself, without involving a third-party. You should get some kind of error, either from the program or in event viewer. If all else fails, there is always [dependency walker](https://en.wikipedia.org/wiki/Dependency_Walker). – JonasH Mar 18 '22 at 13:32
  • Hi everyone i have now fixed the issue! I used Inno Setup and included these .dlls to my execute which now works! – James L Mar 19 '22 at 03:45

1 Answers1

0

What worked for me: Costura Fody, a NuGet that includes .dlls to your execute for you.

You can also use "Embed Interop Files" but after some digging and testing myself I found it didn't work on certain versions and lots of people saying to turn it off.

Another error I had with Costura.Fody which I figured out was you may need to remove the .dlls from your references and add them back in afterwards.

PS. You can also use an installer (like inno setup) if you like but I find it much simpler having it all inside of the execute. Hope this helps like everyone has helped me :)

James L
  • 19
  • 5
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 10 '22 at 02:50