Closed MarkECrum closed 2 years ago
Hi @MarkECrum
Just created a new WinForms app using .NET 6.0 LTS, manually added reference to RoboSharp.dll (.NET 4.5 version) and it works perfectly fine for me.
Just tested adding RoboSharp via Nuget instead of adding it manually and that also worked fine
@tjscience @RFBomb
Related side note after doing quick test for above response - I notice when I add RoboSharp via NuGet to a .NET 6 project that .StartAsync is not available (although it is available when I manually add a reference to the RoboSharp .NET 4.5 DLL rather than using NuGet)
I think we perhaps need to change the preprocessor directives on the below line
from NET45 to NET45_OR_GREATER so it is available on all .NET versions newer than 4.5 rather than just 4.5? Or am I misunderstanding how it works?
Not sure if we will also need to add preprocessor directives on same line so StartAsync is available for .NET Standard, .NET 5, .NET 6 etc?
Just a thought for discussion
Hmmmm, I'll create a new one mirroring your example with a few switches and try it again... thanks, I'll let you know.
On Tue, Dec 14, 2021 at 1:19 PM Darren Rose @.***> wrote:
Hi @MarkECrum https://github.com/MarkECrum
Just created a new WinForms app using .NET 6.0 LTS, manually added reference to RoboSharp.dll (.NET 4.5 version) and it works perfectly fine for me.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tjscience/RoboSharp/issues/122#issuecomment-993853498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW4TIR4DQZMHD6MWWBHOV6LUQ6DEBANCNFSM5KBSDG2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
I just tested the recreation adding a reference manually to the dll. It does not work.... or that is, I have to right click and tell it to "Run as Administrator" Funny though, I have local admin rights!???? When I added this all seemed like it worked. Can anyone tell me what that is all about? Besides the /zb or /b should take care of this... should it not?
I just tested the recreation adding a reference manually to the dll. It does not work.... or that is, I have to right click and tell it to "Run as Administrator" Funny though, I have local admin rights!???? When I added this all seemed like it worked. Can anyone tell me what that is all about? Besides the /zb or /b should take care of this... should it not?
Yes it needs to run as admin, that is correct, and exactly the same as the sample Backup App included in the project. Just because your user account is admin (same here) you still need to run the app as admin, so either right click and run as admin, or set it to run as admin in app.manifest e.g.
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
/zb and /b have nothing to do with how your app runs, the app needs admin rights to run RoboCopy / RoboSharp correctly. /z and /zb are to do with the permissions of the files you are copying using RoboCopy / RoboSharp
Thank you for clearing that up! That I get now! :)
Ok, thanks. That clears it up!
On Tue, Dec 14, 2021 at 3:26 PM Darren Rose @.***> wrote:
/zb and /b have nothing to do with how your app runs, the app needs admin rights to run RoboCopy / RoboSharp correctly. /z and /zb are to do with the permissions of the files you are copying using RoboCopy / RoboSharp
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tjscience/RoboSharp/issues/122#issuecomment-993953355, or unsubscribe https://github.com/notifications/unsubscribe-auth/AW4TIRZPQT7P3WTQCQRQY7TUQ6SARANCNFSM5KBSDG2Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
@tjscience @RFBomb
Further to my comment above yesterday I have been doing some testing in relation to .StartAsync
Currently there is a preprocessor directive set in RoboCommand.cs so that .StartAsync is only available in NET45, which means it is not available if using the NuGet package on an app using a newer version of .NET such as .NET 6.0.
Async/Await is available I believe in all versions of .NET from 4.5 onwards so the preprocessor directive needs changing .
from
#if NET45
to
#if NET45 || NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP3_1
This will then cover all the versions that we currently create NuGet packages for that support Async/Await (which is all except NET40)
I have tested this in depth here and it works fine.
All comments gratefully received, if okay I will make the change and hopefully @tjscience can do a new NuGet release to encompass this and the other fixes / pulls made recently to add new features and to fix the NuGet documentation issue.
More tests run and double checked Async available and working in all builds except .NET4 which is correct as Async/Await support added from .NET 4.5 onwards.
Comment closed and change made
Ok, I am quite new to .net. So if this is not how to post a question, I apologize upfront. I am not what I call an expert programmer by no means but have developed applications in the past.... Just keep that in mind. I Have gone through the code and pretty much understand what is going on with it. However, what I don't understand to a strong degree (because I have not done it yet) is the whole .net targeting and distribution stuff. I do know this.... It shows the dependencies to use lower .net versions. Can this be updated on my end? or What do I have to do to Update it for the latest version?