.net websites are built by IIS .net handler, which calls the aspnet_compiler. two things control the version
1) in the app pool you pick the major version of the framework, 1,2,3 or 4
2) as .net framework updates in place (by major version), the version of the framework installed on the server
with websites, the web.config may have binding statements for nuget packages. It can also replace the version of the .net compiler used (switch to roslyn, which would be included in the bin folder).
for #2, see: