Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Intellisense fails in VS 2019 for generated stubs #61

Open
billyzkid opened this issue Jan 30, 2020 · 3 comments
Open

Intellisense fails in VS 2019 for generated stubs #61

billyzkid opened this issue Jan 30, 2020 · 3 comments

Comments

@billyzkid
Copy link

billyzkid commented Jan 30, 2020

SimpleStubs has an issue where Intellisense fails to work for the generated stubs in VS 2019. The issue occurs in VS 2019 v16.x, including the latest update (v16.4.4).

This was observed in a UWP Unit Test app that references SimpleStubs v2.4.8.2 and a UWP/C# class library containing the stubbed interfaces. The solution builds without errors, the stubs are generated successfully, and the unit tests run, but the text editor shows the dreaded "red squiggles". This same setup worked fine in VS 2017.

Here are the workaround steps:

  1. Close VS 2019
  2. Open the SimpleStubs.targets file included with the installed NuGet package, e.g. %USERPROFILE%\.nuget\packages\simplestubs\2.4.8.2\build\SimpleStubs.targets
  3. Move this ItemGroup block above/outside the Target block and save the updated file:
<ItemGroup>
  <Compile Include="$(SimpleStubsCodeGenOutput)" />
</ItemGroup>
  1. Open the solution in VS 2019
  2. Rebuild the solution

After following the steps above, the issue is resolved in VS 2019. Note the updated SimpleStubs.targets file does not appear to impact VS 2017 which continues to work.

@nehmebilal
Copy link
Collaborator

@billyzkid does that mean we could update the targets file accordingly and ship it with newer NuGets? If so, would you be able to submit a PR?

@billyzkid
Copy link
Author

Unfortunately, I need special permission from my employer to make open source contributions.

@nehmebilal
Copy link
Collaborator

@billyzkid by opening this ticket, you are making an opensource contribution. I suggest to check with your employer but a simple fix is not considered a significant opensource contribution that employers would hold you from making.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants