11

Has anyone seen a problem in .NET Core 1.1 where beneath the netcoreapp1.1\publish folder they end up with a bin folder that seems to loop on itself and eventually causes a path too long message to appear in Windows. Trying to delete this folder in Windows Explorer cause a Source Too Long message to appear. The only solution was to use RoboCopy.

Here is an example of one of the generated paths:

bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\Debug\netcoreapp1.1\publish\bin\release\netcoreapp1.1\publish\bin\release\netcoreapp1.1\publish\bin\release\netcoreapp1.1\publish\bin\release\netcoreapp1.1\publish\bin\release\netcoreapp1.1\publish\Controllers\

Is this a problem caused by something I have setup incorrectly?

The last cleanup returned the following stats:

Folders: 6866 Files: 7391

I am publishing using the following command:

dotnet publish -c debug

It seems each publish makes the folder structure deeper and this seems to be related to the CSHTML files in my project creating this folder structure:

\publish\bin\debug\netcoreapp1.1\publish\Controllers\Account\Views

Then on second build this structure:

  \publish\bin\debug\netcoreapp1.1\publish\bin\debug\netcoreapp1.1\publish\Controllers\Account\Views

And so on...

I am using SDK 1.0.0-preview2-1-003177

Michael Edwards
  • 5,680
  • 3
  • 37
  • 70

2 Answers2

7

I remember that I had same issue with preview2 of .NET Core SDK. It was fixed in either preview3 or preview4. And it is definitely fixed in .NET Core SDK 1.0. as mentioned by @Marc. Just update you SDK https://www.microsoft.com/net/download/core#/sdk.

With new SDK your project will be converted to csproj and MSBuild, so no project.json anymore.

EDIT: Project will automatically be converted in VS 2017, if you use command line tool you should apply dotnet-migrate command.

Andrii Litvinov
  • 9,864
  • 2
  • 45
  • 50
2

Try updating the sdk to release version available now. Version 1.0 and version 1.1 are (at the time of this post) included in one package download from here. https://www.microsoft.com/net/download/core

as Mentioned by @Andrii Litvinov the migration will occur for VS2017. if you need help: Microsoft is offering free migration help for project.json to msbuild. (as of the time of this update march 15 2017]

check out: http://landinghub.visualstudio.com/migrate-dotnetcore

Community
  • 1
  • 1
Marcus
  • 433
  • 3
  • 9
  • Where is the best place to find the string is need to add to the global.json file to indicate that it should used the latest SDK, i.e. the ""1.0.0-preview2-1-003177"" part? – Michael Edwards Mar 13 '17 at 21:30
  • @MichaelEdwards it is not pulled as part of the project it is part of the environment. You need to download and upgrade your Dev environment. – Marcus Mar 13 '17 at 23:08
  • I have run the update EXE but I have no idea what to string value I should now use for the Global.json. Should this update automatically? – Michael Edwards Mar 14 '17 at 18:35
  • @MichaelEdwards the version is not required to be updated, as the development environment is pulling the libraries on the machine at compile time. the SDK is the net core app library that is used in your development library. Your global.json targets a specific version within the library of the SDK. since you had a preview version of the SDK previously, updating the actual SDK will ensure that anything that is used within your project is using production code. – Marcus Mar 14 '17 at 21:56