When creating a fresh .NET Core 8 React project on a fresh developer machine using Visual Studio 2022, I found that I was getting an error that was preventing the application from running locally. Specifically, the errors "Error: Could Not Create Certificate" and "There was an error exporting the HTTPS developer certificate to a file. Please create the target directory before exporting. Choose permissions carefully when creating it." After a little time digging into and little success finding documentation on the issue, I finally sloved my error.
- This applies to any development machines that do not already have a folder created at
%APPDATA%\ASP.NET\https
OR your app home directory (GenerallyC:\Users\USERNAME
or use%HOMEPATH%
)
- Open Visual Studio
- Choose "Create a New Project"
- Select "React and ASP.NET Core" Javascript and Web app from the options
- Try running your application!