SpecFlow GenerateAll <ImportGroup> Unrecognized Error

1,689 views
Skip to first unread message

Matt Gurzenski

unread,
May 25, 2014, 4:22:06 PM5/25/14
to spec...@googlegroups.com
I'm running the following command from the command line: specFlow.exe generateAll "C:\Project\MyProject.csproj" /force /verbose . The following error is returned: The element <ImportGroup> beneath element <Project> is unrecognized.  C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.CSharp.targets"

I used Visual Studio 2013 Express to generate my project file. Has anyone seen this before?

Mark Pitman

unread,
Oct 1, 2014, 1:39:29 PM10/1/14
to spec...@googlegroups.com
Did you ever find a solution to this?

sandeep singh

unread,
Nov 24, 2014, 12:51:31 PM11/24/14
to spec...@googlegroups.com
specflow.exe is compiled for .NET 3.5, it cannot load .NET 4.0 assemblies by default. To generate this report for .NET 4.0 projects, you have to force specflow.exe to use the .NET 4.0 runtime by using the config file.

You need to create one config file called specflow.exe.config with the following content: 

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <startup> 
         <supportedRuntime version="v4.0.30319" /> 
    </startup> 
</configuration>

save and copy to same folder where specflow.exe resides.

Command line should be : specFlow.exe generateAll "C:\Project\MyProject.csproj" /force /verbose

hope this helps.

Robert Comstock

unread,
Sep 18, 2015, 12:59:14 PM9/18/15
to SpecFlow
Sandeep,

I had the same problem and these steps fixed it.  Thanks.

Chris Forbes

unread,
Oct 6, 2015, 11:45:45 AM10/6/15
to SpecFlow
Thanks for the information. i was having an issue getting our project to run on a new TeamCity instance, and this was the (main) issue. I created a MSBuild task which adds the file after restoring the NuGet packages. Tedious, but it works.
Reply all
Reply to author
Forward
0 new messages