SpecFlow has parsing problems - c#

I have a problem with parsing steps in .feature file with implementation which is defined in steps.cs file. Beside that, the same step was parsed successfully just a few lines upper in same scenario in .feature file. All steps bind successfully, with exception of last 2 steps, which fail to bind, although these steps appear for 2nd time.
I tried to delete .cache files in %TEMP%, but it is not that. Besides that, step definition is like:
From steps.cs file, when I do Ctrl+Alt+Shift+S, I get 2 steps recognized, which is ok.
We use VS 2015, specflow for VS2015, and SpecFlowSingleFileGenerator as generator. Same happens with VS 2019, with specflow for VS2019 and SpecFlowSingleFileGenerator as generator.
I must say that we have a plenty of scenarios and features which behave nice (with very very basic regex).
Anybody got any clue for this?
Also, when I enable tracing (Tools->Options->SpecFlow) in Output window of VS, I get the messaages:
[08:51:21.6011171] EditorParser: Start full parsing
[08:51:21.6041087] EditorParser: Finished full parsing in 2 ms, 6 errors
Edit: when I open .feature file for first time on opening solution, it parses everything well at first glance. But after 30 seconds, some of steps transit to unrecognized state, as mentioned above.
Edit 1: seems like this part of regex makes problems - \s*(for remote point ""(.*)"")?.
When I put space before open brace (, I get good parsing. But my steps then aren't functioning anymore.
Edit 2: images removed.
Edit 3: I've got mail from Andreas about this topic:
When the regex of a binding is getting to complex the Visual Studio Extension has problems to match them correctly. I fear your regex is already to complex for it.
The runtime should handle it just fine.
From my experience having these kind of checks in the regex make it hard to see then the error at runtime.
I think you only get an exception that the step can't be matched.
If I have such a restricted range of possible values as in your binding, I always have a runtime check that throws an exception if it doesn't pass.

Related

is there rules for comments in editorconfig file

I did a custom .editorconfig file which I apllied the nameing conventions like(interfaces should begins with I and then Uppercase) and works just fine (except the fact that it doesnt fix the names automatically after i run code cleanup). and i was wondering if there were a set of rules to control the comments, for example, the line should starts with space then the comments, and it should start new line after 100 character.
I dont want to use third party softwares, I would like to use vanilla visual studio

How to resolve "CREATEMULTIDEXMAINDEXCLASSLIST : error : Expecting class path separator ';'........."

Windowa 10
Visual Studio 2017 v15.9.7
Hi all,
I have a Xamarin.Forms solution targetting Pie and a minimaum version of Ice Cream Sndwich..
I am having trouble building the Android project.
After getting the error Java Exit Code 2 I have gone down the route of enabling the Multi-Dex option and have followed this article........
https://riptutorial.com/xamarin-android/example/29859/enabling-multidex-in-your-xamarin-android-apk
Now I've seen that some people have issues with this when there are spaces or special characters in their SDK location path but my problem is slightly different.
I have an apostrophe in my user name and thus, an apostrophe in my user folder.
My error points at this folder.
I've spent hours trying to sort it and my current tactic was to start a new project and add in the NuGet packages one at a time, building after each one, to see when the error occurs in the new project.
It seems that once I added in SkiaSharp.Views.Forms the error begins to occur. If I remove it, the problem goes away. I'm sure tha same can be said for other packages also as per my main project but this is how far I get on the test before the error occurs.
Renaming my user folder is not an option.
My user folder is c:\User\Anthony.D'Cruze.
Here is the error I am getting....
1>"D:\ANTHONY\ANDROID\PushMessaging\FCMClient\FCMClient.csproj" (Build;BuiltProjectOutputGroup;BuiltProjectOutputGroupDependencies;DebugSymbolsProjectOutputGroup;DebugSymbolsProjectOutputGroupDependencies;DocumentationProjectOutputGroup;DocumentationProjectOutputGroupDependencies;SatelliteDllsProjectOutputGroup;SatelliteDllsProjectOutputGroupDependencies;SGenFilesOutputGroup;SGenFilesOutputGroupDependencies target) (1) ->
1>(_CompileToDalvikWithDx target) ->
1> CREATEMULTIDEXMAINDEXCLASSLIST : error : Expecting class path separator ';' before 'Cruze\AppData\Local\Xamarin\Xamarin.Android.Support.v4\23.3.0.0\embedded\classes.jar'' in argument number 2
1>
I'm concluding that it must be an issue with the apostrophe in my name.
Rather than curse my parents for the surname, I'd much rather find a work around.
I was thinking of using a symbol link for my user folder, but that has the potential to mess my pc up to a point where I can't even login, so that will be a last resort if I cannot find a solution elsewhere.
Anyone else experience this.
OK - this far from ideal but has solved my problem.
Basically I have had to have a new profile set up without the apostophe in my name.
Working for a big corporate, this is a pain. Et voila - It builds.
I'm sure there must have been a more suitable solution but it certainly evaded me.
I hoped I could use some kind of symbolic link for the relevent path variable but I couldn't be sure what var and where to set it.
If anone comes accorss this and has a more elegant solution (any would be) please post it here.

anksvn checkin file

I am using the most recent version of anksvn for a visual studio 2008 project file. I now
want to check this code into anksvn, but I am having a problem.
The situtation is, I checked in the most current version of code into anksvn. That is fine.
However I have another version of this code that I did not check out from subversion initially. This other copy of the code was for a 'demo' only. However now this code needs to become the production code. Thus I am trying to determine how to check this code into anksvn.
What I know I can do is to 'remove' the most curent code folder that is in anksvn. I could then place this project folder into that location. since the origianl 'demo' code also includes the current production code.
However I am trying to see if there is a better method to accomplish this goal. Could I possibly use the branch/switch option?
Is the demo code checked out of Subversion at all? I know you didn't check it out, but was it checked out? If it was, you could commit this code back into Subversion, then update your working directory.
It his code has nothing to do with Subversion, you will have to take a more complex route: You will have to copy the changes manually to your code.
Since you're using Windows, you should take a look at Beyond Compare, This is commercial code, but you can download a limited time demo for free -- more than enough time to handle your situation. I use Beyond Compare all the time to compare two different directories or Java jar files or zip archives, etc. It not only can quickly show you the differences, but makes it each to copy those differences from one to the other.
I have no relationship with Scooter software, the makers of Beyond Compare except as a customer.

Slow debugging due to type names output in the output window

For the tl;dr crowd:
What is causing type names to be written to the output window if it isn't Console.WriteLine or Debug.Print statements in the code? Is it the Visual Studio debugger? and
How can I turn it off?
Background and details:
I am trying to debug a program that imports CSV files into a database. Recently, I changed how I include 3rd party library dependencies. Previously, I was referencing the downloaded binary files. Now, if a 3rd party library has source code available, such as NHibernate, the project is included in my solution to be compiled along with the projects I have written myself.
Since the change, I am seeing a lot of single lines containing only a type name in the Output/Debug window that I didn't used to see before. My program is a data importer, and the main loop is causing these lines to appear 1000s of times, slowing down debugging and polluting the output window. Specifically, there are a lot of lines that say this:
NHibernate.Driver.NHybridDataReader
I have traced the code, and it seems that this is displayed whenever NHibernate is reading results back from the database. However, the line isn't output in code by the NHibernate library, so it must be coming from somewhere else. My guess is that the Visual Studio Debugger is writing it to the output window, similar to what happens during assembly binding.
I have tried compiling the NHibernate project in Release mode and everything else in Debug mode, but that didn't fix it. I also tried unchecking "Enable the Visual Studio hosting process" for just the NHibernate project, but that didn't work either.
In summary, my questions are:
What is writing type names to the output window if it isn't Console.WriteLine or Debug.Print statements in the code? and
How can I turn it off?
What my question is not
My question is NOT about a better way to write the data importer program so that the needed data is preloaded from the database. I know the code I have written is slow; in this particular case, in production, that is okay. What I want is to stop polluting the debug window with tons of unneeded type information. The work loop of my program causes the types to be written 1000s of times for long CSV files, which makes the output hard to use, and slows the debugger down as it tries to sync the output window. THIS is what I am trying to prevent. But I'm not sure how to do that, because I'm not even sure where the messages are coming from.
It's difficult to make suggestions without being able to see the code, but what I would do to debug it is install the trial version of RedGate's Reflector and use it to add breakpoints to the Debug.* and Console.* functions. If one of the breakpoints is hit, you can trace back up the call stack to find what is actually adding the lines to the output. If none of those methods are causing the lines to be added, maybe add breakpoints to DefaultTraceListener and TextWriter.
I haven't come across anything else which can add messages to the Visual Studio output window at run time.
I think this is irrelevant, though it solved my seemingly unrelated problem a while back (I had automated tests randomly failing and printing to console). I had to uncheck Visual Studio's "Enable property evaluation and other implicit function calls" under the Debugging menu in Options. Sorry if this is off topic/unhelpful!
EDIT: Also, have you tried changing the 'Output Window' settings in the Debugging section? You could maybe turn all debug output off and print your own debugging to a file.

TFS API InformationNodeConverters.GetAssociatedChangesets() not working as expected

I think I may have misunderstood the purpose of this function, but here's my problem.
When I look in the build summary, I see that a build ran successfully, and it tells me:
[person] triggered [build number] ([project]) for changeset 123456
I have the following code, which runs in a console app to tell me what changesets were included in a build.
IBuildDefinition[] result = buildServer.QueryBuildDefinitions(teamProj.Name);
foreach (IBuildDefinition def in result)
{
IBuildDetail[] dets = def.QueryBuilds();
foreach (IBuildDetail det in dets)
{
det.RefreshAllDetails();
// Get changesets for the buildList<IChangesetSummary> 
changes = InformationNodeConverters.GetAssociatedChangesets(buildDetail);
foreach (IChangesetSummary changeset in changes)
{
}
}
}
The problem is that this returns nothing. The Information propery has 6 nodes, none of which relate to a changeset or a workitem. Why does VS2010 build summary tell me that I have an associated changeset, but the code below tells me different?
What is the state of the build? (Successful, Failed, or Partially Succeeded)? Also, which build process template are you using? Are you using the default build process template and if you are have you made any updates to it? There are a few things that you have to make sure you keep in place if you customize the build to get the AssociateChangesetsAndWorkItems build activity to work properly.
I helped Andy Lewis with some of that information here: http://blogs.msdn.com/b/andy-lewis/archive/2011/01/31/how-good-was-that-build.aspx
The string you mentioned isn't actually what indicates that there are associated changesets. On the build summary screen, you should see a section that says "Associated Changesets." If you don't, then that usually is the first sign that there is a problem.
Let us know some additional information and I'll be happy to help!

Categories