{"action":"created","issue":{"url":"https://api.github.com/repos/OmniSharp/omnisharp-vscode/issues/1587","repository_url":"https://api.github.com/repos/OmniSharp/omnisharp-vscode","labels_url":"https://api.github.com/repos/OmniSharp/omnisharp-vscode/issues/1587/labels{/name}","comments_url":"https://api.github.com/repos/OmniSharp/omnisharp-vscode/issues/1587/comments","events_url":"https://api.github.com/repos/OmniSharp/omnisharp-vscode/issues/1587/events","html_url":"https://github.com/OmniSharp/omnisharp-vscode/issues/1587","id":238253435,"number":1587,"title":"OmniSharp doesn't honor propertygroup condition when loading csproj","user":{"login":"yaronyg","id":1480964,"avatar_url":"https://avatars0.githubusercontent.com/u/1480964?v=3","gravatar_id":"","url":"https://api.github.com/users/yaronyg","html_url":"https://github.com/yaronyg","followers_url":"https://api.github.com/users/yaronyg/followers","following_url":"https://api.github.com/users/yaronyg/following{/other_user}","gists_url":"https://api.github.com/users/yaronyg/gists{/gist_id}","starred_url":"https://api.github.com/users/yaronyg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yaronyg/subscriptions","organizations_url":"https://api.github.com/users/yaronyg/orgs","repos_url":"https://api.github.com/users/yaronyg/repos","events_url":"https://api.github.com/users/yaronyg/events{/privacy}","received_events_url":"https://api.github.com/users/yaronyg/received_events","type":"User","site_admin":false},"labels":[{"id":534208138,"url":"https://api.github.com/repos/OmniSharp/omnisharp-vscode/labels/Needs%20More%20Info","name":"Needs More Info","color":"cccccc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-06-23T21:04:47Z","updated_at":"2017-07-11T17:52:27Z","closed_at":null,"body":"## Environment data\r\n`dotnet --info` output:\r\n\r\n.NET Command Line Tools (1.0.4)\r\n\r\nProduct Information:\r\n Version:            1.0.4\r\n Commit SHA-1 hash:  af1e6684fd\r\n\r\nRuntime Environment:\r\n OS Name:     Windows\r\n OS Version:  10.0.15063\r\n OS Platform: Windows\r\n RID:         win10-x64\r\n Base Path:   C:\\Program Files\\dotnet\\sdk\\1.0.4\r\n\r\nNote: I'm using an old version because Azure IoT Edge Gateway requires it\r\n\r\nVS Code version: 1.13.1\r\nC# Extension version: 1.10.0\r\n\r\n## Steps to reproduce\r\nCreate a SLN and add csproj and set the TargetFramework inside of a PropertyGroup with a condition, for example:\r\n```XML\r\n  <PropertyGroup Condition=\"'$(Framework)'=='1.1.1'\">\r\n      <TargetFramework>netstandard1.3</TargetFramework>\r\n  </PropertyGroup>\r\n```\r\n\r\n## Expected  behavior\r\nWhen VSCode Project loading parses the SLN which contains this csproj I expect it to evaluate the condition and process the TargetFramework as defined. This works fine when I run 'dotnet build' for example (and yes, I made sure the environment variable is set). So this would cause OmniSharp to recognize the project as being netstandard1.3.\r\n\r\n## Actual behavior\r\nOmniSharp thinks the project is .NETFramework,Version=v0.0 and all sorts of failures start coming from OmniSharp."},"comment":{"url":"https://api.github.com/repos/OmniSharp/omnisharp-vscode/issues/comments/314522119","html_url":"https://github.com/OmniSharp/omnisharp-vscode/issues/1587#issuecomment-314522119","issue_url":"https://api.github.com/repos/OmniSharp/omnisharp-vscode/issues/1587","id":314522119,"user":{"login":"DustinCampbell","id":116161,"avatar_url":"https://avatars3.githubusercontent.com/u/116161?v=3","gravatar_id":"","url":"https://api.github.com/users/DustinCampbell","html_url":"https://github.com/DustinCampbell","followers_url":"https://api.github.com/users/DustinCampbell/followers","following_url":"https://api.github.com/users/DustinCampbell/following{/other_user}","gists_url":"https://api.github.com/users/DustinCampbell/gists{/gist_id}","starred_url":"https://api.github.com/users/DustinCampbell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DustinCampbell/subscriptions","organizations_url":"https://api.github.com/users/DustinCampbell/orgs","repos_url":"https://api.github.com/users/DustinCampbell/repos","events_url":"https://api.github.com/users/DustinCampbell/events{/privacy}","received_events_url":"https://api.github.com/users/DustinCampbell/received_events","type":"User","site_admin":false},"created_at":"2017-07-11T17:52:27Z","updated_at":"2017-07-11T17:52:27Z","body":"I see now -- thanks!\r\n\r\nFWIW, I was able to verify that this scenario works just fine with the latest [v1.12-beta2](https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.12.0-beta2) of C# for VS Code.\r\n\r\nHere's what I did to verify:\r\n\r\n1. At the console:\r\n\r\n    ```\r\n    > mkdir test\r\n    > cd test\r\n    > dotnet new console\r\n    > code .\r\n    ```\r\n2. In VS Code, open the .csproj for the project and delete the `<TargetFramework>` property.\r\n3. Add the following `<PropertyGroup>` to the .csproj and save.\r\n\r\n    ```XML\r\n    <PropertyGroup Condition=\"'$(Framework)'=='1.1.1'\">\r\n        <TargetFramework>netstandard1.3</TargetFramework>\r\n    </PropertyGroup>\r\n    ```\r\n4. Close VS Code\r\n5. At the console:\r\n\r\n    ```\r\n    > set Framework=1.1.1\r\n    > code .\r\n    ```\r\n\r\n6. Verify that project opens successfully with no errors.\r\n7. Close VS Code.\r\n8. At the console:\r\n\r\n    ```\r\n    > set Framework=1.1.2\r\n    > code .\r\n    ```\r\n9. Verify that project has errors due to the `<TargetFramework>` not being set.\r\n\r\nIf you're interesting in trying the beta, follow the [Installing Beta Releases](https://github.com/OmniSharp/omnisharp-vscode/wiki/Installing-Beta-Releases)."}}
{"actor":{"display_login":"DustinCampbell"}}