{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1257","repository_url":"https://api.github.com/repos/Microsoft/visualfsharp","labels_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1257/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1257/comments","events_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1257/events","html_url":"https://github.com/Microsoft/visualfsharp/issues/1257","id":159841774,"number":1257,"title":"BadImageFormatException in Prime unit test when --optimize is disabled.","user":{"login":"bryanedds","id":1625560,"avatar_url":"https://avatars.githubusercontent.com/u/1625560?v=3","gravatar_id":"","url":"https://api.github.com/users/bryanedds","html_url":"https://github.com/bryanedds","followers_url":"https://api.github.com/users/bryanedds/followers","following_url":"https://api.github.com/users/bryanedds/following{/other_user}","gists_url":"https://api.github.com/users/bryanedds/gists{/gist_id}","starred_url":"https://api.github.com/users/bryanedds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bryanedds/subscriptions","organizations_url":"https://api.github.com/users/bryanedds/orgs","repos_url":"https://api.github.com/users/bryanedds/repos","events_url":"https://api.github.com/users/bryanedds/events{/privacy}","received_events_url":"https://api.github.com/users/bryanedds/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/visualfsharp/labels/Area-Compiler","name":"Area-Compiler","color":"5319e7"},{"url":"https://api.github.com/repos/Microsoft/visualfsharp/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/Microsoft/visualfsharp/labels/Urgency-Soon","name":"Urgency-Soon","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-06-12T18:52:56Z","updated_at":"2016-08-17T10:01:42Z","closed_at":null,"body":"#### Repro steps\r\n\r\n1. Pull down Prime code library from https://github.com/bryanedds/Prime/commit/43ad2039c51232c554339f820cebbcef794d7120\r\n\r\n2. Open the Prime.sln solution found in ./Prime/Prime folder (should open with VS2015).\r\n\r\n3. Ensure program configuration is set to Debug (should be by default).\r\n\r\n4. Hit F5 to run program.\r\n\r\n#### Expected behavior\r\n\r\nThe program executes and passes a single unit test called EventTests.productWorks () in Program.fs, then exits with code 0.\r\n\r\n#### Actual behavior\r\n\r\nProgram halts with a BadImageFormatException in Observation.fs with error -\r\n\r\n```\r\nException thrown: 'System.BadImageFormatException' in Prime.exe\r\n\r\nAdditional information: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)\r\n```\r\n\r\n#### Known workarounds\r\n\r\nEnable --optimize+ in F# project settings. Not a good workaround since it cripples debugging tools like variable inspection and granular breakpoints.\r\n\r\n#### Related information \r\n\r\nI ran the generated executable through peverify and received the following -\r\n\r\n```\r\nC:\\Program Files (x86)\\Microsoft Visual Studio 14.0>peverify C:\\Development\\Prime\\Prime\\Prime\\Prime\\bin\\Debug\\Prime.exe\r\n\r\nMicrosoft (R) .NET Framework PE Verifier.  Version  4.0.30319.0\r\nCopyright (c) Microsoft Corporation.  All rights reserved.\r\n\r\n [HRESULT 0x8007000B] - An attempt was made to load a program with an incorrect format.\r\n\r\n [HRESULT 0x8007000B] - An attempt was made to load a program with an incorrect format.\r\n\r\n [HRESULT 0x8007000B] - An attempt was made to load a program with an incorrect format.\r\n\r\n [HRESULT 0x8007000B] - An attempt was made to load a program with an incorrect format.\r\n\r\n[IL]: Error: [C:\\Development\\Prime\\Prime\\Prime\\Prime\\bin\\Debug\\Prime.exe : Prime.Observation+subscribe@38-1[b,a,w,o]::Invoke][offset 0x000000B4] Unable to resolve token.\r\n [HRESULT 0x8007000B] - An attempt was made to load a program with an incorrect format.\r\n\r\n [HRESULT 0x8007000B] - An attempt was made to load a program with an incorrect format.\r\n\r\n [HRESULT 0x8007000B] - An attempt was made to load a program with an incorrect format.\r\n\r\n [HRESULT 0x8007000B] - An attempt was made to load a program with an incorrect format.\r\n\r\n[IL]: Error: [C:\\Development\\Prime\\Prime\\Prime\\Prime\\bin\\Debug\\Prime.exe : Prime.Observation+subscribe@102-2[b,a,w,o]::Invoke][offset 0x0000008B] Unable to resolve token.\r\n10 Error(s) Verifying C:\\Development\\Prime\\Prime\\Prime\\Prime\\bin\\Debug\\Prime.exe\r\n```\r\n\r\nObviously, this is an issue with the code being generated by the F# compiler with --optimize off.\r\n\r\n* Operating system - Windows 7\r\n* Branch - N/A\r\n* .NET Runtime, CoreCLR or Mono Version - .NET 4.6\r\n* Editing Tools (e.g. Visual Studio Version) - Visual Studio 2015 Community\r\n* Indications of severity - Rather severe - inhibits essential debugging tools, and seems to be a problem encountered by many users.\r\n\r\n#### Contact Information\r\n\r\nbryanedds@gmail.com"},"comment":{"url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/comments/240368464","html_url":"https://github.com/Microsoft/visualfsharp/issues/1257#issuecomment-240368464","issue_url":"https://api.github.com/repos/Microsoft/visualfsharp/issues/1257","id":240368464,"user":{"login":"AviAvni","id":1097246,"avatar_url":"https://avatars.githubusercontent.com/u/1097246?v=3","gravatar_id":"","url":"https://api.github.com/users/AviAvni","html_url":"https://github.com/AviAvni","followers_url":"https://api.github.com/users/AviAvni/followers","following_url":"https://api.github.com/users/AviAvni/following{/other_user}","gists_url":"https://api.github.com/users/AviAvni/gists{/gist_id}","starred_url":"https://api.github.com/users/AviAvni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AviAvni/subscriptions","organizations_url":"https://api.github.com/users/AviAvni/orgs","repos_url":"https://api.github.com/users/AviAvni/repos","events_url":"https://api.github.com/users/AviAvni/events{/privacy}","received_events_url":"https://api.github.com/users/AviAvni/received_events","type":"User","site_admin":false},"created_at":"2016-08-17T10:01:42Z","updated_at":"2016-08-17T10:01:42Z","body":"@dsyme @bryanedds  After I build the compiler I try to debug it but visual studio cant load the pdbs even when i try to load them manualy"}}
{"actor":{"display_login":"AviAvni"}}