I solved this issue by going to the project solution (whose build) was giving this error.
- right click on the project and unload the project.
- Then right click on the project and edit the .csproj file.
- Look for these temp (problematic) generated files. (see example code)
- remove this file references from the .csproj file.
- Right click on project and load back the project.
- Rebuild the solution.
- Its good to go now…
they look like this in the csproj file:
<Compile Include="src\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs" />
<Compile Include="src\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs" />
<Compile Include="src\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs" />