How to replace dotnet40 with dotnet45?
You can try running the wine built-in Uninstaller program. Issue from the command prompt:
$ wine uninstaller
See: https://wiki.winehq.org/Uninstaller
For me, after uninstalling from wine, still had issues with installing dotnet452. This command run in the linux terminal worked for me:
winetricks --force dotnet452