Running SpecFlow Report - ERROR - The attribute "Label" in element <Target> is unrecognized - unit-testing

I have been following the tutorial found here for a SpecFlow test report generator.
My issue is, when I run the tool, I receive the following message:
The attribute "Label" in element Target is unrecognized
I've found a few possible solutions, none of which have worked e.g. here
I am able to show that I am running version 4.x as when I run MSBuild using the Visual Studio 2012, command prompt I can see the following:
Microsoft (R) Build Engine version 4.0.30319.17929 [Microsoft .NET
Framework, version 4.0.30319.18052]
I have created a config file as suggested here
but unfortunately I am still getting the error. The project is running locally off git and this issue has been fixed in the past by using the config file, however since swapping to a VMware Virtual machine, it is now occurring again.
I have also right clicked > Properties which states that the file is using .NET 4.0, in addition created a Environment Variable linking directly to the MSBuild directory. I've spent a good while browsing the internet and cannot get this working. Please help!
Many thanks for any help you can provide,
Cheers!

Solved this with the internal devs. There was some problem with the Chromedriver update script which had been added by (I'm assuming NuGet)
Starting
<PropertyGroup Label="DownloadChromeDriverBuildTask">
and also:
<Target Name="DownloadChromeDriver" Label="DownloadChromeDriverBuildTask">
It was a small script that was installing ChromeDriver if it was not already available. Removing this seems to have resolved it. Hope this provides help to anyone with a similar issue.

Related

SpecFlow/MSBuild Codebehind Gen - Generate All task

On a project I am working on, I am maintaining some Feature Tests written in SpecFlow. Our team started using Visual Studio 2017 about a year ago, and we finally got around to doing some upkeep on our tests!
Our tests for the project I'm working on were originally written in SpecFlow 2.3.2, and were last updated in Visual Studio 2015.
The SpecFlowSingleFileGenerator is known to not work on VS 2017, so I spent the better part of yesterday changing our suite to use the MSBuildSingleFileGenerator instead as detailed in this article in SpecFlow's official documentation
Problem:
Locally, I can build my solution, including the Feature Test project just fine.
However, I keep getting the following error when I try to build the project on our build server:
[exec] C:\CheckoutDirectory\My Awesome Project\packages\SpecFlow.Tools.MsBuild.Generation.2.3.2\build\SpecFlow.Tools.MsBuild.Generation.targets(45,5):
error MSB4036: The "GenerateAll" task was not found.
Check the following:
1.) The name of the task in the project file is the same as the name of the task class.
2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface.
3.) The task is correctly declared with <UsingTask> in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin" directory. [C:\CheckoutDirectory\My Awesome Project\AwesomeProject.FeatureTest\AwesomeProject.FeatureTest.csproj]
I should point out that our team has no experience with writing MS Build tasks, as hitherto we haven't needed to; we use NAnt build scripts on TeamCity to manage our build work. It's clear that error message would be helpful...if we knew literally anything about it.
Now, normally the correct answer would be: Google it. I did that, and this specific error has no pertinent results.
Additionally, this is blocking my team, since we need our build to work. I don't have the time to do the research and education necessary to properly understand how MS Build technology works. That wil have to come later.
Question:
Bearing in mind that SpecFlow has broken our process, and our team's lack of knowledge about the MS Build system: I need to know how to get around the "GenerateAll" task was not found error. What do I do to get around it?
Secondary Question:
I'm also open to lateral thinking. Is there some way to hack either VS 2017 or SpecFlow to make the SpecFlowSingleFileGenerator "compatible" with each other? The objective here is NOT to avoid making changes, but to control the changes. I need a path towards transitioning from the old file generator to the MS build generation system.
Additional Information:
So, I did some digging, and I found a place where "GenerateAll" is being called in the SpecFlow.Tools.MsBuild.Generation.targets file:
<Target Name="UpdateFeatureFilesInProject"
DependsOnTargets="BeforeUpdateFeatureFilesInProject"
Inputs="#(SpecFlowFeatureFiles)" Outputs="#(SpecFlowFeatureFiles->'%(RelativeDir)\%(Filename).feature.cs')">
<GenerateAll
ShowTrace="$(ShowTrace)"
BuildServerMode="$(BuildServerMode)"
OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
ProjectPath="$(MSBuildProjectFullPath)"
ForceGeneration="$(ForceGeneration)"
VerboseOutput="$(VerboseOutput)"
DebugTask="$(SpecFlow_DebugMSBuildTask)"
>
<Output TaskParameter="GeneratedFiles" ItemName="SpecFlowGeneratedFiles" />
</GenerateAll>
</Target>
Because I've confirmed that this is being copied out to the build server, the situation is yet more mysterious. It appears that the NuGet package is being pulled down faithfully. Therefore, I can't figure out why my local copy is behaving differently than the copy on the build server.
I am not sure where you found this statement:
The SpecFlowSingleFileGenerator is known to not work on VS 2017
The SpecFlowSingleFileGenerator is working in VS2015, VS2017 and VS2019. We see it as a legacy feature, but it's still there. Since some weeks it is disabled by default, but you can enable it in the options.
It works for SpecFlow >= 2.3.2 and 2.4. For SpecFlow 3 you have to use the MSBuild integration. There are some problems with older versions of SpecFlow, but with them it can also work. It depends on your setup.
About your MSBuild error:
The MSBuild Task for SpecFlow < 3.0 is in the specflow.exe. Is it on your build server?
It is part of the SpecFlow NuGet packages. Normally you get this kind of error if MSBuild can't find the assembly where the task is.
For "debugging" problems with MSBuild, I can highly recommend to use the MSBuild Structured Log Viewer (http://msbuildlog.com/). With it, it makes it easy so see what is happening in your build.
We have an example for MSBuild Code- Behind- Generation with SpecFlow 2.3.2 here: https://github.com/techtalk/SpecFlow-Examples/tree/master/MSBuild/OldCSProj_SpecFlow232
You could compare your project with this example.
Full disclosure: I am one of the maintainers of SpecFlow.

After opening website in VS2017 - Error Publishing Customization

I am relatively new to Acumatica. I have been following the Development series of training videos and hit a hard stop on T300 video 4 after opening the website in Visual Studio and then trying to publish the changes in my customization project (after detecting/updating changed files).
Error:
The CodeDom provider type "Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" could not be located.
My environment is pretty simple:
Acumatica ERP 2018R1
Visual Studio Community Edition
Windows 10 Pro build 1803
I found a number of posts suggesting that I install a nuget package, which may or may not have helped but did not fix the problem. (Microsoft.CodeDom.Providers.DotNetCompilerPlatform)
I stumbled across a reference to the node_modules folder (sorry, lost that post link) which prompted me to check my TST vs DEV instances, and I found it does not exist in my TST instance. I also then noticed that the error I received during publishing happens after a series of lines about node_modules.
After a little more digging, I found https://stackoverflow.com/a/43494775 which seems to have stopped the node_modules folder from being created and appears to have solved my problem publishing inside of Acumatica.
Other posts for visual studio claimed that the issue comes from the C++ compiler not being included in GAC in VS2017, but I completed the T100 and T200 courses on VS2017 without any issue. The problem seems to be connected specifically to opening the Acumatica Website in VS2017.
Does anyone have any experience with this issue that can confirm disabling NPM restores won't cause me headaches down the road? Or is there a better solution? I don't recall anything in the setup guides telling me to make this change, and I haven't found any references that this was an issue before VS2017.
I do recall running into this in older version of 2018R1.
These posts helped me solve the issue:
This post solved it for me:
How can I disable NPM package restore in Visual Studio 2015?
Also with help from this post:
Getting File Path error while adding file to files list in Customization Manager
if you still have the node_modules related folder just delete it and you should be good (from what I can remember).
If these don't work try the latest 2018R1 build. (or at least 2018R1 Update 1)

Building Django on Visual Studio Online

I'm working on a Django (1.8.6) project and using Visual Studio Online's GIT source control. I am building the application successfully in my local environment and push the changes to the VSO. However, whenever I try to build the application on VSO to be able to benefit from "Continuous Integration" as a next step (will try to deploy Azure), it fails by giving the error below:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Python
Tools\Microsoft.PythonTools.Web.targets (235, 5) The environment 'env
(Python 3.4) (unavailable)' is not available. Check your project
configuration and try again.
Unexpected exit code received from msbuild.exe: 1
My build definition on VSO:
Build Definition Screenshot
Python Version: 3.4.3
VS Version: 2015
Any suggestions regarding to my case is highly appreciated.
This is a known issue for PTVS. MS is still working on it. Refer to this thread for details: https://github.com/Microsoft/PTVS/issues/128
There is a workaround in that thread you may use, I quote it here. The second link is unavailabe now, but the first one still works.
For deployment via PowerShell, I found this, which looks correct
AFAIK.
http://www.kenneth-truyers.net/2014/02/06/deploying-cloud-services-to-azure-with-powershell/
You can also use the Python Azure SDK to deploy, but that's not as
well documented. This is what this test does:
https://github.com/Azure/azure-sdk-for-python/blob/master/tests/test_servicemanagementservice.py#L940
Both of these assume that you are able to create the .cspkg, as that's
the file you have to upload to blob storage.

Use Jenkins CI for Qt projects

I'm trying to use Jenkins for some project I have written in Qt framework.
There is qmake plug-in for Jenkins in Jenkins wiki page, although this plug-in doesn't exist in Jenkins plug-in list.
I've looked for .hpi file for qmakebuilder plug-in, couldn't find it though. So I download the source code from the given repository, tried to compile it as described in Jenkins wiki... but I get list of error indicating java.util.NoSuchElementException.
Any of you guys have used this plug-in? or any other Jenkins plug-in to compile Qt projects with?
First of all, my JAVA_HOME variable was not pointing at the right folder i.e. JDK folder and it was set to JRE which caused the maven to not work properly.
But after fixing that, I was still getting some compilation error.
Finally, I asked Jenkins people and realized for some reason qmakebuilder is not compatible with JDK 7. Therefore, I download the JDK 6 compile the code with that version and it got compiled just fine. I got the hpi file in the target folder.
Plus, the hpi file for this plug-in NOW can be find here.

FluentNhibernate and SQLite

I can't get SQLite Driver working in my sessionfactory.
I downloaded SQLite 1.0.48 from http://sqlite.phxsoftware.com/
I have added the references to System.Data.SQLite in my Tests project.
public static IPersistenceConfigurer GetSqlLiteConfigurer()
{
try
{
return SQLiteConfiguration
.Standard
.InMemory();
}
catch (Exception ex)
{
throw ex;
}
}
This is how I generate the Configurer
The problem is when I build my sessionfactory I get the following error:
NHibernate.HibernateException: The IDbCommand and IDbConnection implementation in the assembly System.Data.SQLite could not be found. Ensure that the assembly System.Data.SQLite is located in the application directory or in the Global Assembly Cache. If the assembly is in the GAC, use <qualifyAssembly/> element in the application configuration file to specify the full name of the assembly.
at NHibernate.Driver.ReflectionBasedDriver..ctor(String driverAssemblyName, String connectionTypeName, String commandTypeName)
at NHibernate.Driver.SQLite20Driver..ctor()
I have tried to change of SQLite version but did not fix the issue.
I can't find what's the problem and I have been working on this for 2 days now.
Let me know if you need more information.
Thanks for the help!
Charles
When I ran into this issue it was caused by running having my application's processor property set to anycpu and running on a 64bit system. To correct the issue I set my application processor property to x86.
I don't think the System.Data.SQLite.dll supports running under a x64 process.
I have fixed my problem by getting the System.Data.SQLite.dll file that is in the FluentNHibernate SVN Repository.
This is now working very well.
I should have checking this earlier ;)
Check, if you are using 4.0 as your target framework. The ADO-driver currently (1.0.66) supports only 3.5.
I am hitting the same problem on a build machine. It works fine when I open the project with Visual Studio, but when I run mstest.exe it fails with the above error. It also fails on my local development machine when I run by command line. Process Monitor shows no attempts to even locate the file by mstest.exe.
The build machine is 32-bit, my local machine is 64-bit. The assembly we are using is the one from the Fluent NHibernate trunk.
UPDATE: Figured it out - mstest.exe wasn't copying all of the assemblies when it was being run from the command line. I updated the localtestrun.config to include them under Deployment. Not sure why the behaviour is different from the IDE and command line test runner.
This issue should be fixed with the lastest NuGet package from Microsoft.
PM> Install-Package SQLitePCL
https://www.nuget.org/packages/SQLitePCL/3.8.2
http://msopentech.com/blog/2014/02/03/new-open-source-portable-class-library-sqlite/