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

[.Net 6.0 Preview 7] Microsoft.NET.Sdk.Razor.StaticWebAssets.targets DirectoryNotFoundException #35561

Closed
vsfeedback opened this issue Aug 20, 2021 · 2 comments · Fixed by dotnet/sdk#19873
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Author: Migration Bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author. Done This issue has been fixed feature-static-web-assets

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


When building a c# project on the .NET 6.0 Preview 7 SDK, if my .csproj file has "AppendTargetFrameworkToOutputPath" set to false, I get a DirectoryNotFound exception. Note the "net6.0" in the path that cannot be found.

42>C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(425,5): error : System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Repos\PangaeaAppliance\src\Service\<myproject>\obj\Debug\net6.0\StaticWebAssets.build.json'.
42>C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(425,5): error :    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
42>C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(425,5): error :    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
42>C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(425,5): error :    at System.IO.FileStream.. ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
42>C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(425,5): error :    at System.IO.File.InternalWriteAllBytes(String path, Byte[] bytes, Boolean checkHost)
42>C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(425,5): error :    at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
42>C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(425,5): error :    at Microsoft.AspNetCore.Razor.Tasks.GenerateStaticWebAssetsManifest.PersistManifest(StaticWebAssetsManifest manifest)
42>C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(425,5): error :    at Microsoft.AspNetCore.Razor.Tasks.GenerateStaticWebAssetsManifest.Execute()
42>C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk.Razor\build\netstandard2.0\Microsoft.NET.Sdk.Razor.StaticWebAssets.targets(425,5): error : Could not find a part of the path 'C:\Repos\PangaeaAppliance\src\Service\<myproject>\obj\Debug\net6.0\StaticWebAssets.build.json'.

Original Comments

Feedback Bot on 8/20/2021, 02:18 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

Feedback Bot on 8/20/2021, 03:49 AM:

This issue is currently being investigated. Our team will get back to you if either more information is needed, a workaround is available, or the issue is resolved.


Original Solutions

(no solutions)

@ghost ghost added the Author: Migration Bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author. label Aug 20, 2021
@javiercn javiercn added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-static-web-assets labels Aug 20, 2021
javiercn added a commit to dotnet/sdk that referenced this issue Aug 20, 2021
* Fixes an issue with projects not working with reference assemblies
  using HintPath.
* Fixes an issue where files without an extension where being included
  inside an additional folder with the file name on nuget packages.
* Adds additional error logging for the brotli compression tool.
* Adds additional login for the gzip compress task.
* Adds editor config files in the blazor wasm and razor sdk folders
  to handle 'var' usage preferences in ASP.NET Core projects.
* Performs a more selective filtering for static web assets candidates
  from the build candidates in blazor webassembly applications.
* Fixes an issue with AppendTargetFramework=false causing issues

dotnet/aspnetcore#35349
dotnet/aspnetcore#32744
dotnet/aspnetcore#29561
dotnet/aspnetcore#35561
@ghost ghost added Done This issue has been fixed and removed Working labels Aug 20, 2021
javiercn added a commit to dotnet/sdk that referenced this issue Aug 20, 2021
* Fixes an issue with projects not working with reference assemblies
  using HintPath.
* Fixes an issue where files without an extension where being included
  inside an additional folder with the file name on nuget packages.
* Adds additional error logging for the brotli compression tool.
* Adds additional login for the gzip compress task.
* Adds editor config files in the blazor wasm and razor sdk folders
  to handle 'var' usage preferences in ASP.NET Core projects.
* Performs a more selective filtering for static web assets candidates
  from the build candidates in blazor webassembly applications.
* Fixes an issue with AppendTargetFramework=false causing issues

dotnet/aspnetcore#35349
dotnet/aspnetcore#32744
dotnet/aspnetcore#29561
dotnet/aspnetcore#35561
javiercn added a commit to dotnet/sdk that referenced this issue Aug 24, 2021
* Fixes an issue with projects not working with reference assemblies
  using HintPath.
* Fixes an issue where files without an extension where being included
  inside an additional folder with the file name on nuget packages.
* Adds additional error logging for the brotli compression tool.
* Adds additional login for the gzip compress task.
* Adds editor config files in the blazor wasm and razor sdk folders
  to handle 'var' usage preferences in ASP.NET Core projects.
* Performs a more selective filtering for static web assets candidates
  from the build candidates in blazor webassembly applications.
* Fixes an issue with AppendTargetFramework=false causing issues

dotnet/aspnetcore#35349
dotnet/aspnetcore#32744
dotnet/aspnetcore#29561
dotnet/aspnetcore#35561
@XtremeOwnageDotCom
Copy link

Can also confirm this issue, which popped up with preview 7.

@tang2087
Copy link

I can also confirm this issue when using CLI to create the project and build.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Author: Migration Bot 🤖 The issue was created by a issue mover bot. The author may not be the actual author. Done This issue has been fixed feature-static-web-assets
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants