Question: How do you solve for an error in MVC AspNet 6 using Visual Studio 2022 that says "NotSupportedException: Path "wwwroot\MyFolder\MyFileName.Extension" was not rooted"? I am trying to download a file from this Folder Location.
Please Login to see the rest of the answer
1. Navigate to Visual Studio 2022 Solution Explorer Section tab or Window.
2. Find the File you would want to access or download when the application gets started (on startup or runtime).
3. Right-click on the file and navigate to Properties Menu.
4. From the Slide-Out menu that shows up, select "Copy Always" on the Lable "Copy to Output Directory".
5. Bould your project again and verify that the file was indeed copied to the Bin Directory.
Other Similar Article