I recently had a C# web solution where I had to upgrade from .NET 3.5 to .NET 4.5 to upgrade TLS 1.2 security. I changed the build setting in the properties of each project of the solution which now builds just fine. I am also able to update the code behind just fine, but now I can't make any changes to the ascx.cs files for any user controls. If I do, there are build errors.
I looked up the solutions for the erro message I get: The value for the 'compilerVersion' attribute in the provider options must be 'v4.0' or later if you are compiling for version 4.0 or later of the .NET Framework
but they all say to remove or update the compilation tag in the web config. I tried removing it and that didn't work and the tag shows 4.5 and lower 4.0 as expected. here are the tags in the web config
<compilation targetFramework="4.5">
<assemblies>
<add assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
<add assembly="System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=[some token]"/>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID"/>
If it makes a difference, this is a set of modules for dotnetnuke (and the publish on Dnn7 works fine I just again can't make changes to the user controls, I need to do this to maintain the software)