0
votes

I am creating a new Specflow project in VS2017. I have added 1 rule in the features file and generated the initial steps code. However, when I attempt to build the project I get the following 2 errors. (1) CS1029 #error: 'Generation error: Object reference not set to an instance of an object.' (2) Custom tool error: Generation error: Object reference not set to an instance of an object.

Feature file contains,

Feature: Change_Theme_Change_Scheme

@Change_Theme_Change_Scheme
Scenario: Verfy change of scheme
    Given I log into Admin site
    And I navigate to Colour Scheme page
    And I select the Kumho theme
    When I click the Save Theme button
    Then Check website main menu background is Red

Steps file contains,

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TechTalk.SpecFlow;
namespace Tyres_and_Service_Tester.Steps
{
    [Binding]
    public sealed class Change_Theme_Change_Scheme
        {
        [Given(@"I log into Admin site")]
        public void GivenILogIntoAdminSite()
        {
            ScenarioContext.Current.Pending();
        }
        [Given(@"I navigate to Colour Scheme page")]
        public void GivenINavigateToColourSchemePage()
        {
            ScenarioContext.Current.Pending();
        }
        [Given(@"I select the Kumho theme")]
        public void GivenISelectTheKumhoTheme()
        {
            ScenarioContext.Current.Pending();
        }
        [When(@"I click the Save Theme button")]
        public void WhenIClickTheSaveThemeButton()
        {
            ScenarioContext.Current.Pending();
        }
        [Then(@"Check website main menu background is Red")]
        public void ThenCheckWebsiteMainMenuBackgroundIsRed()
        {
            ScenarioContext.Current.Pending();
        }
    }
}

Image of project references

enter image description here

I've not come across this before when building Specflow projects with earlier versions of VS, and cannot figure out what I've done differently Many thanks for any help. Tony

1
did you try run VS as administrator? - Vijayanath Viswanathan
What kind of project did you use in Visual Studio? - Koen Meijer
Please also post your app.config - Andreas Willich

1 Answers

0
votes

Thank you for all your responses. I decided to start from scratch again adding the Specflow packages to VS, and recreating the features, steps etc. As you might of guessed it worked this time - so I'm at a loss what might of been going on. Anyway this question can be closed.