Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API Proposal]: Please add a method to the C# library to copy a directory with all its contents #61873

Closed
aks2161989 opened this issue Nov 20, 2021 · 5 comments

Comments

@aks2161989
Copy link

Currently C# does not have an inbuilt method to copy a directory and all its contents. To achieve this task, one needs to write code for it. An example is given on the MSDN website.

What is strange, however, is that VB.NET already has an inbuilt method which allows you to achieve this task in one line. Sure, one can add a reference to Microsoft.VisualBasic in their C# project and call the VB.NET method, but I am sure most C# developers would appreciate if such a method were to be incorporated in the language itself.

What's more is that C# has long tried to compete with Java and has succeeded in many aspects. However, Java already has inbuilt methods to copy a directory and its contents and does not require extra work to achieve this. If such a feature were to be added to C#, it would definitely enhance the competitiveness of the language.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Nov 20, 2021
@teo-tsirpanis
Copy link
Contributor

Hello, adding such reference is no longer needed in C# projects that target modern .NET. You can add a using Microsoft.VisualBasic.FileIO in your code straight away without changing your project file.

@ghost
Copy link

ghost commented Nov 20, 2021

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

Currently C# does not have an inbuilt method to copy a directory and all its contents. To achieve this task, one needs to write code for it. An example is given on the MSDN website.

What is strange, however, is that VB.NET already has an inbuilt method which allows you to achieve this task in one line. Sure, one can add a reference to Microsoft.VisualBasic in their C# project and call the VB.NET method, but I am sure most C# developers would appreciate if such a method were to be incorporated in the language itself.

What's more is that C# has long tried to compete with Java and has succeeded in many aspects. However, Java already has inbuilt methods to copy a directory and its contents and does not require extra work to achieve this. If such a feature were to be added to C#, it would definitely enhance the competitiveness of the language.

Author: aks2161989
Assignees: -
Labels:

area-System.IO, untriaged

Milestone: -

@svick
Copy link
Contributor

svick commented Nov 20, 2021

This is a duplicate of #60903.

@adamsitnik
Copy link
Member

@aks2161989 Thank you for your proposal. Since this is a duplicate, I am going to close the issue. Please follow #60903 for updates.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2021
@adamsitnik adamsitnik removed the untriaged New issue has not been triaged by the area owner label Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants