{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/844","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/844/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/844/comments","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/844/events","html_url":"https://github.com/Microsoft/visualfsharp/issues/844","id":124357879,"number":844,"title":"Changing target F# runtime incorrectly updates assembly binding redirects","user":{"login":"TeaDrivenDev","id":2247219,"avatar_url":"https://avatars.githubusercontent.com/u/2247219?v=3","gravatar_id":"","url":"https://api.github.com/users/TeaDrivenDev","html_url":"https://github.com/TeaDrivenDev","followers_url":"https://api.github.com/users/TeaDrivenDev/followers","following_url":"https://api.github.com/users/TeaDrivenDev/following{/other_user}","gists_url":"https://api.github.com/users/TeaDrivenDev/gists{/gist_id}","starred_url":"https://api.github.com/users/TeaDrivenDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeaDrivenDev/subscriptions","organizations_url":"https://api.github.com/users/TeaDrivenDev/orgs","repos_url":"https://api.github.com/users/TeaDrivenDev/repos","events_url":"https://api.github.com/users/TeaDrivenDev/events{/privacy}","received_events_url":"https://api.github.com/users/TeaDrivenDev/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-30T14:55:04Z","updated_at":"2016-01-07T17:45:33Z","closed_at":null,"body":"I have a project (of type \"Windows Application\") created with VS 2013 targeting F# 3.1; the `<runtime>` section in `app.config` looks like this:\r\n\r\n    <runtime>\r\n      <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\r\n        <dependentAssembly>\r\n          <assemblyIdentity name=\"System.Net.Http.Primitives\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\r\n          <bindingRedirect oldVersion=\"0.0.0.0-4.2.22.0\" newVersion=\"4.2.22.0\" />\r\n        </dependentAssembly>\r\n      </assemblyBinding>\r\n      <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\r\n        <dependentAssembly>\r\n          <assemblyIdentity name=\"FSharp.Core\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\r\n          <bindingRedirect oldVersion=\"0.0.0.0-4.3.1.0\" newVersion=\"4.3.1.0\" />\r\n        </dependentAssembly>\r\n      </assemblyBinding>\r\n    </runtime>\r\n\r\nChanging the target F# runtime to 4.0 in VS 2015 adds binding redirects to FSharp.Core 4.4.0.0, but also keeps the existing one to 4.3.1.0:\r\n\r\n    <runtime>\r\n      <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\r\n        <dependentAssembly>\r\n          <assemblyIdentity name=\"System.Net.Http.Primitives\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\r\n          <bindingRedirect oldVersion=\"0.0.0.0-4.2.22.0\" newVersion=\"4.2.22.0\" />\r\n        </dependentAssembly>\r\n        <dependentAssembly>\r\n          <assemblyIdentity name=\"FSharp.Core\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\r\n          <bindingRedirect oldVersion=\"2.0.0.0\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"2.3.0.0\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"2.3.5.0\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"4.0.0.0\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"4.3.0.0\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"3.3.1.0\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"2.3.5.1\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"3.78.3.1\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"3.259.3.1\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"4.3.1.0\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"3.47.4.0\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"3.78.4.0\" newVersion=\"4.4.0.0\" />\r\n          <bindingRedirect oldVersion=\"3.259.4.0\" newVersion=\"4.4.0.0\" />\r\n        </dependentAssembly>\r\n      </assemblyBinding>\r\n      <assemblyBinding xmlns=\"urn:schemas-microsoft-com:asm.v1\">\r\n        <dependentAssembly>\r\n          <assemblyIdentity name=\"FSharp.Core\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\r\n          <bindingRedirect oldVersion=\"0.0.0.0-4.3.1.0\" newVersion=\"4.3.1.0\" />\r\n        </dependentAssembly>\r\n      </assemblyBinding>\r\n    </runtime>\r\n\r\nThe odd thing is that for another F# project in the same solution, the same change leads to a correct update of its binding redirects, both when set to \"Class Library\" and \"Windows Application\"."},"comment":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/comments/169753041","html_url":"https://github.com/Microsoft/visualfsharp/issues/844#issuecomment-169753041","issue_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/844","id":169753041,"user":{"login":"enricosada","id":147243,"avatar_url":"https://avatars.githubusercontent.com/u/147243?v=3","gravatar_id":"","url":"https://api.github.com/users/enricosada","html_url":"https://github.com/enricosada","followers_url":"https://api.github.com/users/enricosada/followers","following_url":"https://api.github.com/users/enricosada/following{/other_user}","gists_url":"https://api.github.com/users/enricosada/gists{/gist_id}","starred_url":"https://api.github.com/users/enricosada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enricosada/subscriptions","organizations_url":"https://api.github.com/users/enricosada/orgs","repos_url":"https://api.github.com/users/enricosada/repos","events_url":"https://api.github.com/users/enricosada/events{/privacy}","received_events_url":"https://api.github.com/users/enricosada/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T17:45:33Z","updated_at":"2016-01-07T17:45:33Z","body":"maybe in   https://github.com/Microsoft/visualfsharp/blob/a3dc921d93d1d68d3bc5861a2ee33dcc75c5cd5d/vsintegration/src/vs/FsPkgs/FSharp.Project/FS/AppConfigHelper.fs#L354\r\n\r\n```fsharp\r\n//TargetMin,  targetMax,    redirects\r\n\"4.3.1.0\",    \"4.4.1.0\",    [\"3.3.1.0\";    \"2.3.5.1\";   \"3.78.3.1\";   \"3.259.3.1\"; \"4.3.1.0\"]\r\n```\r\n\r\nthe function only check newVersion, if exists doesnt delete it, only add missing\r\n\r\n```fsharp\r\nredirects |> Seq.iter(fun r -> if r <> targetFSharpCoreVersion then createRedirect fsharpCoreDependentAssemblyElement (r, targetFSharpCoreVersion))\r\n```\r\n\r\ni dont see a check for `..` in that code\r\n"}}