Specflow error: Force regenerate steps possible?

后端 未结 11 1902
猫巷女王i
猫巷女王i 2021-02-01 14:32

Is it possible to \"force\" regenerate step definitions for a specflow feature file? I have created this feature file but cannot generate all steps. Am getting a message that al

11条回答
  •  轮回少年
    2021-02-01 15:15

    SpecFlow creates a .cache file in your Temp folder that holds these bindings to speed things up. If that file gets out of whack, you can delete it:

    1. Exit Visual Studio.
    2. Open Windows Explorer.
    3. In the address bar, type %TEMP% and hit Enter to go to your temp folder.
    4. Find the files whose names start with "specflow-stepmap-YourProjectName" with a .cache extension.
    5. Delete those files.
    6. Start Visual Studio again.

    If you do this, it'll take a little time for SpecFlow to regenerate the bindings. Until this is done, if you right-click on a step and select "Go To Step Definition", Visual Studio will reply "Step bindings are still being analyzed. Please wait."

    I most commonly use this for the opposite case, where SpecFlow shows that nothing is bound even though the steps exist. But I think it's likely to work for your case as well.

提交回复
热议问题