|
Good news!
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
I have tried to pass command line arguments to IrfanView to rotate a image, the code is below, the commented code works without a problem. The problem is the uncommented code, when the process is started, there are no errors but no changes are made to the image. I have tried the proper syntax code in VB.NET and it works as expected, any insight as to what's wrong?
//args = file1 + " " + "/rotate_r " + "/convert=" + file2 + "/killmesoftly";
//args = " " + file1 + " " + "/rotate_r " + "/jpgq=100" + "/convert=" + file2 + "/killmesoftly";
args = " " + file1 + " " + "/jpg_rotate=(3,1,0,1,0,0,0,0)" + "/killmesoftly";
|
|
|
|
|
I don't know why newbs always insist on breaking up what should be a single string into a bunch of string concatenations, making it harder to debug your code. You can do this all in one string:
args = $"{file1} /jpg_rotate=(3,1,0,1,0,0,0,0) /killmesoftly";
Take a closer look at your uncommented code:
args = " " + file1 + " " + "/jpg_rotate=(3,1,0,1,0,0,0,0)" + "/killmesoftly";
This will result in an arguments string that looks like this:
[file1]
Notice there is no space before the /killmosoftly switch. That will probably generate an error for the Irfan command.
modified 7-May-24 23:37pm.
|
|
|
|
|
Dave;
Thank you for responding, unfortunately the image was not rotated. As I stated previously the string works in Excel VBA & VB.NET with the correct file location syntax.
Thanks again for your help
|
|
|
|
|
I didn't say I knew anything about Irfan, only that your code is unnecessarily complicated, making it harder to debug.
|
|
|
|
|
Adding to Dave's wise words, your uncommented string doesn't specify an output file, so it may very well execute the process and discard the result.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Peter;
Thank you for responding. There is no switch for an output file, because the original file is overwritten.
|
|
|
|
|
Hi everyone,
hard to phrase a title for what i am looking for, therefore following explanation.
I have the requirement to establish communication to a device via Secure WebSockets using TLS 1.3 and need to research on how i can do that from our applications that sadly are running with .NET Framework 4.0.
What i found out yet is that it might be a pain to get Secure WebSockets with TLS 1.3 running with that old framework and therefore i need to find a proper solution on how to circumnavigate this issue.
My Idea:
The old application will talk with a service / server specifically designed to just do the communication part, meaning the old stuff doesn't get touched and the service can run with .NET 8, which obviously should support the requirement.
What my questions are:
Does anyone have an idea or can point me into the right direction in terms of:
- How do they both communicate with each other (I would prefer not to use any COM stuff if possible)
- What type of project to use for the .NET 8 app?
--> I heard of the "Worker services in .NET" which seems the right thing to me, since the "service" needs to be run on demand (Only if required to be used), should support multiple connections and should not show stuff on a console while running.
Since the idea is to have a "secure" connection it would be strange if all the info can be read via COM communication. On the other hand that's a fairly new area for me, so i have no clue if that is just the way to go and does work "secure" as well. My head just says COM sounds old and may be wrong, but don't hate me for that
Additionally:
Regarding installation or installation of a "Service" there won't be much of issue afaik, in the end the user simply doesn't care, shouldn't know or bother how the magic works behind the UI.
Many thanks in advance!
Rules for the FOSW ![ ^]
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");
|
|
|
|
|
HobbyProggy wrote: TLS 1.3 running
C# doesn't do TLS unless both the libraries and OS have the correct versions. Following has the magic of SecurityProtocolType.Tls12 and comment mentions the version of .Net needed.
https://stackoverflow.com/questions/55240173/how-to-handle-httpwebrequest-c-sharp-with-tls-1-3[^]
For OS following claims Windows server 2022 is needed. Although I thought there was a prior version where it could be turned on.
TLS1.3 is it supported? - Microsoft Q&A[^]
There are also encryption protocols that must be enabled or disabled.
Now all of the above is to make it easy. Question might be if someone could add a native library of some sort (not C#) and implement it from scratch. After all linux presumably has it and that means the code should exist. But I have not researched that myself.
|
|
|
|
|
Good point, i'll have to check back with the hardware team then, cause they implement TLS 1.3 on the device and exepct us to connect to it via Secure Websockets and TLS 1.3.
Rules for the FOSW ![ ^]
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");
|
|
|
|
|
|
Thanks for the Link Richard, sometimes my google foo seems off...
Uhm, long story short: There is a bunch of old men that define a standard i have to align to and use their libraries and software and put my stuff somewhere in-between. This application is running on 4.0.3 and that is why i am targeting that. The app loads my code and then i load the base stuff as well and all of that is compiled as 2.0 Standard.
Therefore my thought of extracting this TLS / Websocket bit into a "Service / Server" my old fart code can communicate with. And i already found out that Pipes do work like a charm there.
Rules for the FOSW ![ ^]
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");
|
|
|
|
|
HobbyProggy wrote: This application is running on 4.0.3 ... compiled as 2.0 Standard
If you mean .NET Standard 2.0[^], that requires at least .NET Framework 4.6.1, and preferably 4.7.2 or higher.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Exactly... well now i am really confused, my testing app is 4.7.2 but the version info of the official application is .NET 4.0.3. So additionally to not knowing 100% how all of that stuff works i even don't know how this specific works out!
*edit*
My Test app as well looks like .NET 4.0.3 or am i just dumb today?
Console output: DeviceModel: .NET Version 4.0.30319.42000
'TestApp.exe' (CLR v4.0.30319:TestApp.exe): Loaded
'C:\ProgramData\...\Device.dll'.
Rules for the FOSW ![ ^]
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");
modified 8-May-24 7:27am.
|
|
|
|
|
|
Interesting but keep in mind that the code as written does not 'use' TLS 1.3. Rather it attempts to specify it and then backs down if the system tells says it is not available.
I suspect one would also want to verify that something else is not also doing a backdown even further down the line. (Keep in mind my first post where I mention that encryption algorithms might also be needed which is only determined by the windows OS.)
|
|
|
|
|
I downloaded and installed a package from nuget
When I compile source code exe file cannot find dll file
but after package installation dll appeared on disk
How to fix it without using visual studio or copying dll's
modified 5-May-24 2:29am.
|
|
|
|
|
Check your project references, and if they all look OK, check the folders: the compiled DLL needs to be in the "bin" folder under the relevant project. If you have the references set correctly, the required non-system DLL files will be built and then copied to the bin folders.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I added reference to the dll at compile time and executable was created but executable cannot find dll to load
This program has two files one cs and one dll
I compiled it from command line with csc given with Windows
(Windows gives us .Net Framework 4.8 and C# up to 5.0)
(It is simple program with one cs file and one dll file so i don't want to create project for that)
Yes copying the dll to the program folder is kind of solution but wasting disk space
Such copying is unnecessary in my opinion and better way would be for example choosing path to dll
for executable
I would like to do not need copying dlls to program folder for each program which uses that dll
Now I am trying to extract data from html and I found nuget package for this
Some time ago I found Rational number class I downloaded and installed it via nuget and executable couldn't
locate dll
But when I compiled dll from sources there was no problems with finding and loading dll by executable
|
|
|
|
|
Check the build parameters: if your exe is 64 bit and the DLL is 32 then it can't load it, and vice versa.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hello, I divided my solution for a third party dll in VS 2022 into
a) 1st.dll in project 1
b) 2nd.dll in project 2
Project 1 references project 2 and creates instances of objects based on classes in project 2.
Both dlls are copied to the same folder but only 1st.dll is loaed by an Application to which I have no access except vie an API used by my 1st.dll.
My understanding was, that 2nd.dll is kind of linked to 1st.dll, so that it is no necessary in the same folder. I also only want to ONLY ship 1st.dll. But when I delete 2nd.dll from the path my approach does not work.
Question:
What do I have to to, so that it is sufficient to only have 1st.dll at the customer side available ?
|
|
|
|
|
No, the .DLL's are not "linked" in the way you're seem to be thinking. 2.dll is NOT "linked into" 1.dll. They will remain separate .DLL's when you compile them. You said it yourself, 1 REFERENCES 2, so the two .DLL's must be shipped together.
You have a choice. You can either rewrite and get rid of the second project, copying your code in the 2 project into the 1 project, then update the references and namespace using statements, rebuild and you'll get your 1.dll file you can ship.
OR
You can try to use ILMERGE[^] to combine both .DLL's into the same file. You may or may not get away with doing this.
|
|
|
|
|
Hello & thank you for your reply. Is there a reason why in C#/.Net we do not have statically linkable libraries (.lib-Files) like in C/C++ ?
|
|
|
|
|
No, static linking is not directly supported. If you want to know why, ask Microsoft.
The closest approximation to it is to use ILMerge or similar. Not every library is compatible though, like WPF assemblies or code that uses Reflection.
|
|
|
|
|
Imagine you have a switch with anything between 3 and a silly amount of comparisons, at which size does a lookup dictionary with delegates get faster?
I'm fully aware there are no exact answers to this, I just want some elaboration on what's affecting the performance.
|
|
|
|