Open nikokreuzer opened 2 months ago
The Visual studio team maintains this tooling and can't be addressed in this repo. If you file your issue through VSFeedback, it can be triaged by the appropriate team.
Thanks for the issue report @nikokreuzer! This issue appears to be a problem with Visual Studio, so we ask that you use the VS feedback tool to report the issue. That way it will get to the routed to the team that owns this experience in VS.
If you encounter a problem with Visual Studio, we want to know about it so that we can diagnose and fix it. By using the Report a Problem tool, you can collect detailed information about the problem, and send it to Microsoft with just a few button clicks.
Sent Visual Studio for Windows bug report https://developercommunity.visualstudio.com/t/Unable-to-perform-a-Build-or-publish-a-B/10633316?port=1025&fsid=9c4b8cfc-f097-45d1-81eb-c76a56a5c4b6
I can confirm the exact same Problem.
Description
Unable to perform a Build or publish a Blazor Hybrid App for iOS Targets. Initially stumbled upon this while working on a bigger app where the IPA should be triggered by a Windows machine calling msbuild.exe (and/or dotnet publish), but it's easily reproducable using Visual Studio 2022 with its template, default setup and built-in mechanisms. I will rely on this to describe how to reproduce the issue.
I'm getting the following error message:
Error MSB4018 The "GenerateStaticWebAsssetsPropsFile" task failed unexpectedly. System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\T2\StaticWebAssetTest\StaticWebAssetTest\obj\Release\net8.0-ios\ios-arm64\staticwebassets\msbuild.StaticWebAssetTest.Microsoft.AspNetCore.StaticWebAssets.props'.
As you can see, the project root resides in a delibaretly short file path as to not exceed path limits on Windows.
Steps to Reproduce
C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.2.8043
to the remote Mac~/Library/Caches/Xamarin/XMA/SDKs/sdk-manifests/8.0.100/microsoft.net.sdk.ios/17.2.8043
Link to public reproduction project repository
No response
Version with bug
8.0.3 GA
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iOS
Did you find any workaround?
I did not find a workaround. The often reported solution is to use a shorter path name, but I tried that - the file path in this example has a length of 133. I also have the registry setting for long path names on (1).
Playing around I noticed that sometimes the following folder exists and contains files: (ProjectFolder)\obj\Release\net8.0-ios\iossimulator-x64\staticwebassets while this folder is empty: (ProjectFolder)\obj\Release\net8.0-ios\ios-arm64\staticwebassets
This fact made me try this while being paired to either an Intel-based Mac and a M1-based Mac, the error remains the same.
When starting the build the "SayHello" Task is started twice before the error shows up, even when net8.0-maccatalyst and all other targetframeworks are removed and I only have this in my csproj:
<TargetFrameworks>net8.0-ios</TargetFrameworks>
I also noticed that immediately after this error occurs, in Debug mode you can sometimes just press play and the Debug session will start, and in Release mode you may call dotnet publish and it will go through (only managed to do this once with a template app, not my full app). It appears that the files arrive too late and the build will fail, but the subsequent Debug or Publish can use the files.
Relevant log output