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

Intellisense fails in VS 2019 for generated stubs #61

@billyzkid

Description

@billyzkid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions