visual-studiomsbuildcsc

Error while building solution Arithmetic operation resulted in an overflow - CSC error CS7065: Error building Win32 resources


Got this error while building solution on CI server using VS2019 - 16.7.4

Any idea from where it could come from ? It doesn't happen all the time and only one solution. Can workaround by cleaning completely build working folder

CSC error CS7065: Error building Win32 resources : Arithmetic operation resulted in an overflow

Solution

  • First of all, please enter VS IDE, Tools-->Options-->Projects and Solutions-->Build and Run--> set MSBuild project build output verbosity to Detailed to get the detailed build log to locate the specific error.

    If you use msbuild command line, you can add -v:detailed to get the detailed build log.

    Then, try the following steps:

    1) check every resource files, right-click on every that file-->Properties-->change its Build Action to Resource or Content`.

    enter image description here

    2) try to use Configuration Any CPU to build your project.

    3) close VS Instance, delete .vs hidden folder, bin and obj folder and then rebuild your project again.

    Besides, if the issue still persists, please share more detailed build log and description about the issue so that it will help us troubleshoot the issue quickly.