I am running a 32-bit ASP.NET application using .NET Framework 4.8. I am getting the following error when starting the application:
error CS1504: Source file 'c:WindowsMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Files...xxx.cs' could not be opened ('Unspecified error ')
What I have tried
- Running the application in IISExpress and Local IIS both in 32-bit mode.
- Updating Visual Studio
- Rebooting
- Reinstalling Visual Studio 2022 and .NET Framework 4.8
- Move the location of the temporary files folder to a different location using configuration
- Remove the Temp folder/files / clean / rebuild
2
Answers
I found out what the issue was. There were language features that needed to be installed through Visual Studio 2022.
Go to Build => ASP.NET Compilation => Enable latest C# and VB language features
Try –
Delete the ‘Temporary ASP.NET Files’ folder. Restart your computer, clean the solution and rebuild the solution