Since a couple of weeks I suddenly have issues with the SpecFlow extension in Visual Studio 2019 (professional edition). Out of the blue it stopped working. First I thought because of an update of VS, but other colleagues of mine are using the same (latest) version of VS and for them SpecFlow works.
The problems I'm experiencing are:
No settings menu for SpecFlow (Tools - Options - SpecFlow)
A NullReferenceException when opening a feature file (see end of post for entry of activity log)
When feature file is opened no syntax highlighting
No context menu
The test explorer is still discovering the tests and I can still run them, but not from the feature file (neither debugging the steps).
The extension is installed and enabled correctly (as far as I can tell).
Already tried the following without success:
Uninstall and install the SpecFlow for Visual Studio 2019 extension
Uninstall SpecFlow and install Deveroom
Uninstall Visual Studio 2019 and install again
Any of you have any idea on what might be causing this?
Activity log entry
<entry>
<record>806</record>
<time>2021/02/09 09:25:56.786</time>
<type>Error</type>
<source>Editor or Editor Extension</source>
<description>System.NullReferenceException: Object reference not set to an instance of an object.
at TechTalk.SpecFlow.VsIntegration.LanguageService.ProjectScopeFactory.<.ctor>b__9_0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\ProjectScopeFactory.cs:line 52
at TechTalk.SpecFlow.VsIntegration.Implementation.Utils.SynchInitializedInstance`1.EnsureInitialized()
at TechTalk.SpecFlow.VsIntegration.LanguageService.ProjectScopeFactory.<.ctor>b__9_2(Project project) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\ProjectScopeFactory.cs:line 64
at TechTalk.SpecFlow.VsIntegration.Implementation.Utils.SynchronizedResultCache`3.GetOrCreate(TSource source)
at TechTalk.SpecFlow.VsIntegration.LanguageService.ProjectScopeFactory.GetProjectScope(Project project) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\ProjectScopeFactory.cs:line 76
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinLanguageServiceFactory.CreateLanguageService(ITextBuffer textBuffer) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinLanguageServiceFactory.cs:line 51
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinLanguageServiceFactory.<>c__DisplayClass7_0.<GetLanguageService>b__0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinLanguageServiceFactory.cs:line 43
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinBufferServiceManager.<>c__DisplayClass3_0`1.<GetOrCreate>b__0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinBufferServiceManager.cs:line 32
at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func`1 creator)
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinBufferServiceManager.GetOrCreate[TService](ITextBuffer textBuffer, Func`1 creator) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinBufferServiceManager.cs:line 29
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinLanguageServiceFactory.GetLanguageService(ITextBuffer textBuffer) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinLanguageServiceFactory.cs:line 43
at TechTalk.SpecFlow.VsIntegration.GherkinFileEditor.GherkinFileClassifierProvider.<>c__DisplayClass3_0.<GetClassifier>b__0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\GherkinFileEditor\GherkinFileClassifierProvider.cs:line 31
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinBufferServiceManager.<>c__DisplayClass3_0`1.<GetOrCreate>b__0() in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinBufferServiceManager.cs:line 32
at Microsoft.VisualStudio.Utilities.PropertyCollection.GetOrCreateSingletonProperty[T](Object key, Func`1 creator)
at TechTalk.SpecFlow.VsIntegration.LanguageService.GherkinBufferServiceManager.GetOrCreate[TService](ITextBuffer textBuffer, Func`1 creator) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\LanguageService\GherkinBufferServiceManager.cs:line 29
at TechTalk.SpecFlow.VsIntegration.GherkinFileEditor.GherkinFileClassifierProvider.GetClassifier(ITextBuffer buffer) in D:\a\1\s\TechTalk.SpecFlow.VSIXShared\GherkinFileEditor\GherkinFileClassifierProvider.cs:line 30
at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTaggerProvider.<>c__DisplayClass12_0`1.<CreateTagger>b__0(IClassifierProvider provider)
at Microsoft.VisualStudio.Text.Utilities.GuardedOperations.InvokeEligibleFactories[TExtensionInstance,TExtensionFactory,TMetadataView](IEnumerable`1 lazyFactories, Func`2 getter, IContentType dataContentType, IContentTypeRegistryService contentTypeRegistryService, Object errorSource)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
</description>
</entry>
Edited:
After running a repair of VS I could see the menu option for the 'Clear MEF Component Cache' extension. Unfortunately using this got me no further with the SpecFlow extension (still the same issues).
This looks like the MEF cache of Visual Studio has a problem.
An easy way to clean it is the Clear MEF Component Cache extension from Mads Kristensen. It can be found on the marketplace here: https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ClearMEFComponentCache
Install it and after a restart of VS, execute the command in the menu:
After that, restart VS again and the SpecFlow VS Extension should work again.
Due to different issues I received a complete new image on my laptop from the IT department. Due to this the issues with SpecFlow are also resolved. I still don't know exactly what has caused this, but my guess would go to a slightly corrupted registry or something similar.
Anyway no need to answer this anymore.
Related
With the latest visual studio 2022 17.3.0 update, my xamarin native app can't be started in debug as I keep getting this message:
Forwarding debugger port 8811
Detecting existing process
I have tried to clean and unistall app from the phone.
Same project works fine on visual studio 2019.
Thanks
Just activate Use Fast Deployment, i was having the same issue, but i activated this option, and now works!!!
I am also experiencing this. Multiple devices. I can use Visual Studio 2019 and it works fine. It was working with Visual Studio 2022 until the last update. Tried cleaning solution, manually deleting obj directories, manually uninstalling from device, etc.
Main errors I get are...
[monodroid] Creating public update directory: /data/user/0/com.lathem.payclock/files/.__override__
[art] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8864,server=y,embedding=1
[monodroid-assembly] Failed to load managed assembly 'mscorlib.dll'. Internal error
[monodroid-assembly] open_from_bundles: failed to load assembly mscorlib.dll
[mono] The assembly mscorlib.dll was not found or could not be loaded.
[mono] It should have been installed in the `/Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/sdks/out/android-armeabi-v7a-release/lib/mono/2.1/mscorlib.dll' directory.
And this...
Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(String format, Object[] args)
at Mono.AndroidTools.AndroidLogger.LogError(String task, String format, Object[] args) in D:\a_work\1\s\External\androidtools\Mono.AndroidTools\AndroidLogger.cs:line 63
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass118_0.b__0() in D:\a_work\1\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 1012
I'm just now learning about SpecFlow. I'm trying to work through the BookShop example here and my attempt to Run All Tests reveals a build error:
Error MSB4018 The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly.
TechTalk.SpecFlow.SpecFlowException: Missing [assembly:GeneratorPlugin] attribute in
C:\Users\john.robottom\.nuget\packages\specrun.specflow.3-40\3.4.5\build\\net471\SpecRun.Generator.SpecFlowPlugin.dll
I've googled around, but I'm unclear if I need to downgrade something (if so, what and how to downgrade), un-install and re-install (what), etc.
I don't see how to reply to Greg's questions via a comment (it says I can't comment until I have 50 points). So, here is my attempt to answer to Greg's questions (if you need other info, Greg, just let me know):
SpecFlow.Plus.LivingDocPlugin: 3.4.2
SpecRun.Runner: 3.3.41
I'm using Visual Studio 2019 Enterprise
I'm running tests from Test Explorer in Viual Studio.
Basically, I followed the example and took the latest stable (as of a few days ago) NuGet package for any packages referenced in the example.
The example is at: https://docs.specflow.org/projects/specflow/en/latest/Getting-Started/Getting-Started-With-An-Example.html
I am getting this Kind of Error like::
Specified argument was out of the range of valid values.Parameter name: site
while Debugging any of my Project.
I have also tried after Reinstalling My Visual Studio 2012. But again the same kind of problem I am getting while Debugging.
My System's Configurations are :
Windows 8 : 32-bit
Visual Studio : 2012
Exception is thrown at the time of Showing Web Page Like,
[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: site]
System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +298
[HttpException (0x80004005): Specified argument was out of the range of valid values.
Parameter name: site]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
If using IIS:
control panel
Programs
open or close windows features
tick internet information services
then restart your visual studio
If using IIS Express:
Open 'Add/Remove Programs' from the old control panel and run a repair on IIS Express
Or you might go Control Panel ->> Programs ->> Programs and Features ->> Turn Windows features on or off ->> Internet Information Services
and check the checkbox as shown in the picture below:
This occurred to me when I applied the 2017 Fall Creator Update. I was able to resolve by repairing IIS 10.0 Express (I do not have IIS installed on my box.)
Note: As a user pointed out in the comments,
Repair can be found in "Programs and Features" - the "classic" control panel.
I had the same issue i resolved it by repairing the iis server in programs and features.
GO TO
Controll panel > uninstall a program
and then right click the installed iis express server (installed with Visual Studio)
and then click repair.
this is how i solved this issue
I had the same issue with VS2017. Following solved the issue.
Run Command prompt as Administrator.
Write following two commands which will update your registry.
reg add HKLM\Software\WOW6432Node\Microsoft\InetStp /v MajorVersion /t
REG_DWORD /d 10 /f
reg add HKLM\Software\Microsoft\InetStp /v MajorVersion /t REG_DWORD
/d 10 /f
This should solve your problem. Refer to this link for more details.
Instead of installing the bloated IIS, I get mine resolved by installing Internet Information Services Hostable Web Core from the Windows Features
When you start with a Specific Page while debugging your project, and you are using Local IIS,
you might have filled a wrong value in the Specific Page textbox.
(via Project Properties > Web > Start Action > Specific Page)
Wrong configuration:
Specific Page: "http://localhost/MyApplication/Start/SpecificPage.aspx"
Project Url: "http://localhost/MyApplication"
Right configuration:
Specific Page: "/Start/SpecificPage.aspx"
Project Url: "http://localhost/MyApplication"
Note: Ignore the quotation marks.
If you are okay with using the built in Visual Studio Development server or you don't want to or cannot install IIS, you can change the web server the project uses by going into
Project Properties (right click project in solution explorer and select properties)
select Web tab
select "Use Visual Studio Development Server".
I don't know how it happened to me, but somehow this option was changed to "Use Local IIS Web Server" for one of my projects.
This resolved the issue on Windows 10 after the last update
go Control Panel ->> Programs ->> Programs and Features ->> Turn Windows features on or off ->> Internet Information Services
But based on previous response it doesn't work unless checking all these options as on pic below
For me, it was happening because I had switched over to "Run as Administrator". Just one instance of VS was running, but running it as admin threw this error. Switching back fixed me right up.
Modify was greyed out for me, but adding the IIS Management Console under programs and features fixed this for me. Also on Windows 10 fall update.
I got this issue when trying to run a project targeting Framework 4.5 in VS2017. After changing it to Framework 4.6.X it got fixed by itself.
Navigate to Control Panel > Programs > Programs and Features and repair the IIS Express.
Restart the visual studio.
To turn on the IIS is not recommended as other comments suggests if you are not using your system as a live server. For development purpose only IIS Express is adequate.
This is my friend's his project that I need, it works perfectly fine but here it struggles to start up, giving this error:
Severity Code Description Project File Line
Error The "GenerateResource" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Build.Tasks.ResGenDependencies.GetResXFileInfo(String resxFile)
at Microsoft.Build.Tasks.GenerateResource.ShouldRebuildResgenOutputFile(String sourceFilePath, String outputFilePath)
at Microsoft.Build.Tasks.GenerateResource.GetResourcesToProcess(List`1& inputsToProcess, List`1& outputsToProcess, List`1& cachedOutputFiles)
at Microsoft.Build.Tasks.GenerateResource.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() RecipesApp
I've read many solutions: this is my Obj folder if this helps any:
Deleted my entire 'obj' folder and it seems to work.
The temporary solution seems to be this:
completely delete all build outputs and build again (bin and obj directories)
This seems to be a known bug in the RTM of Visual Studio 2015 (or better said in the MSBuild tool which Visual Studio uses). changing files from windows explorer or overwriting Solution parts or even changing the directory of project are known cases of this incident.
the issue is that an internal cache gets interpreted incorrectly on the old bits, causing this crash.
So delete the bin and obj folder from your project and try again.
The fix seems to be deployed in Visual Studio 2015 Update 1. If you haven't installed that yet, I would give that a try.
We just set up TFS 11 for the first time. Running a gated check in, it succeeds but returns this message:
'srctool.exe' returned an unexpected exit code: '-1'. An error
occurred when opening a file "CustomDllName.dll": Assembly
"CustomDllName.dll" is not a valid .NET assembly and will be skipped
for analysis.
Well, it's right: that file is a legacy Visual Basic 6 DLL that we don't have much control over. It's included in the project for COM access to some of the methods.
Is there a way to instruct srctool.exe/TFS to skip that file when doing the inspection? Or another way to attack this?
Here is the solution that ultimately worked for me
A member of the TFS 11 team at Microsoft mentioned to me that the problem is due to a change in behavior that the Windows 8 team made to the srctool.exe tool.
By copying this file from the Windows 7 SDK (WinDBG) toolkit and overriding the one included in TFS 11 Beta, I was able to successfully run a build without any errors.
Is this a srctool.exe error from the shipped IndexSources activity? srctool.exe in this activity does one thing, which is to list the source files information in the pdb. I am not a srctool expert so I don't know why it fails in this case. I do know that srctool.exe has some behavioral changes in version 11, most of those are fixes from the previous version.
There is a workaround which requires udpating the build template. It is not very nice but it works. Srctool.exe is run (inside IndexSources activity) for each pdb file in the SymbolFiles collection. Now that you know which pdb fails, you can update the build template to add a RemoveFromCollection activity before the IndexSources activity that remove the troubled pdb from the SymbolFiles collection. This is by far the most straightforward workaround I can think of.
Alternatively, you can edit FindMatchingFiles activity's search pattern to exclude the pdb files you don't want to have sources indexed.
Based on the error message you got, it doesn't seem to be related to the known issue Ed mentioned. We fixed this issue for the next release, so if it's related, it should be fixed :-)
Let me know if you have any issue with VS11 Beta around the build templates.
Thanks.