S
S
Sergey Korenevsky2022-02-16 15:25:27
.NET
Sergey Korenevsky, 2022-02-16 15:25:27

How to build a console application in one file on .NET 6 in Visual Studio in C#?

Due to limitations in Windows Explorer, it is not possible to copy files with a path greater than 250 characters.
I wrote a Visual Studio .NET 6 console application. Which in the folder I need (700Gb) looks for folders and files whose address is longer than 250 characters.
As a rule, these are backups that contain other backups, and so on.
To sort it out, you need to know these paths that go beyond the limit.
.
Actually the question is in the title.
I do everything according to the instructions:

https://ru.stackoverflow.com/questions/1282216/How...
and here I also check
https://docs.microsoft.com/ru-ru/dotnet/core/deplo...
visual-studio-publish-edit-settings.png
visual-studio-publish-single-file-properties.png
.
So, after the settings. I click the "Publish" button
There is an inscription "The publication is executed DATE, TIME"
I open a folder for the publication. And she is NOT.
I tried different methods with the choice of Windows support version, bit depth, but the folder does not appear.
If I'm doing it right, how can I find out what the problem is, how to catch the error?
And it is strange that there is a message about the successful publication.

Info: I noticed that there is a similar folder in the publish folder in \obj , but of course there are no executable files there.

If interesting.
That program is simple, console, thanks to you I wrote it. Shows a list of folders and files whose paths are greater than 250 characters. Since the evil Windows Explorer has a 250 character limit for copying files.
There is no way to make backups. With large backup volumes, there will always be 1000 files that will give an error when copying.
I hope the program will be useful.
https://disk.yandex.ru/d/q6YMB4pSRc3Kgw

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2022-02-16
@Dier_Sergio_Great

Well, if it says that the publication is done, then it is most likely done somewhere. Check that the path you specified for the publication is correct.
PS Actually, in the log, a little higher, the absolute path of the publication is displayed. At least in VS2019 it looks like this .
PSS It turns out that if there is a project file in the project file, <IsPublishable>False</IsPublishable>when you try to publish, it will not be indicated anywhere that it is disabled (well, at least it didn’t catch my eye) ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question