SpecRun+Nunit > Adding new feature file to project causing generating plugin not found error cs1029 - specflow

This happens to me everytime! Have hooks setup and other feature files in the project.
I click on feature folder - add item (SpecFlow Feature File)
Name it and alter the gherkin syntax.
Right click Generate definition and add to steps folder
I delete VS Bin folder and Rebuild Solution.
I will then get the plugin error code CS1029 - no matter what I do I cannot prevent this error from popping up!

Figured out why I would get the error of needing to regenerate feature files then wind up with a compilation error of SpecRun could not find plugin.
The project I had grabbed did not have up to date NuGet Packages! If you have SpecRun+Nunit as the UniteTestprovider - (I am on VS 2015, with extension Specflow for Visual Studio 2015 installed). Be sure the Nuget package for SpecRun is updated to the latest Stable version.
Your app config can have plugin [add name="SpecRun"] (Found some post mentioning to delete this, you do not)
You do not need to delete the bin folder and reopen vs. Just make sure Nuget packages for SpecRun is the latest.

Related

Nuget Restore in MS Build Step

In my asp.net web application, i have solution with 5 projects and nuget.org. In TFS Build Definition,
1) While building the whole solution in Visual Studio Build Task
Nuget packages getting restored.
2) While trying to generate executable files for individual projects in MS Build Task
If I select Restore Nuget packages, It's not finding nuget packages and step getting failed with message - "Process 'NuGet.exe' exited with code '1'."
I have tried many references online and none worked. Any suggestions on how to solve this?
Do i need to make any changes in the nuget.config file to support restoring
packages to individual projects.
Do not directly select Restore Nuget pacakges in MS build task configuration. This option is deprecated. To restore NuGet packages, add a NuGet Installer step before the build.
(Important) This option is deprecated. Make sure to clear this
checkbox and instead use the NuGet Installer build step.
Source Link: MSBuild
Besides, you could also build single project not the entire solution in Visual Studio Build task. Just select the project (.*proj) files instead of .sln file.
Unless you are building a customized MSBuild project file, then we recommend you use the MSBuild step instead of the Visual Studio Build step.
You could also try to build single project using Visual Studio Build task, see if the issue is still exists.
Same problem, downgraded to 4.4.1. it helped

References don't show up in Visual Studio 2017 after creating a .NET Standard branch

I'm working with Visual Studio 2017 on the open-source project https://github.com/SpiegelSoft/XamarinForms.Reactive.FSharp
I recently created a branch called dotnet-standard, which, as its name suggests, is a migration to .NET Standard. However, after creating this branch and checking back in to the master branch, which is a PCL rather than a .NET standard library, the project will no longer build.
First of all, the references are not visible. All I can see in Visual Studio is a .NET node (see screenshot).
The build fails in the first instance with
Xamarin.Forms targets have been imported multiple times. Please check your project file and remove the duplicate import(s).
This is odd because the same fsproj file was working before I created the new branch.
When I delete the Xamarin.Forms import line in my fsproj file and then perform a git reset --hard, the error message changes to
Your project is not referencing the ".NETPortable,Version=v4.5,Profile=Profile259" framework. Add a reference to ".NETPortable,Version=v4.5,Profile=Profile259" in the "frameworks" section of your project.json, and then re-run NuGet restore.
But the IDE won't even let me a a project.json file. Something has clearly gone very wrong with my Visual Studio settings.
Does anyone have any obvious tips before I reinstall Visual Studio?
As alluded in the comments, VS / MS Build can trip up on previously generated files - often in the various obj folders.
To get back to a ‘clean’ state (the same as when you first clone a repo), run git reset —hard to revert any uncommitted changes and git clean -xfd to remove any untracked files and folders.
Assuming your .gitignore file is configured correctly, this last step should remove all temporary files.

Visual Studio 2015 Nuget Restore Problems for Version 1.0.3 of Newtonsoft.Json.dll

I have a solution which was working with Visual Studio 2015 Community in a machine. That machine was crashed and I can not access the source codes over there any more.
However the source codes were checked into TFS. After I got new machine, I got all latest source codes from TFS.
The issue is that this solution in new machine has a lot of compile errors.
Visual Studio 2015 could restore some of the references. However I have a complain like this -
Clicking button Restore will have this error -
I don't think I have used a version of 1.0.3 of Newtonsoft.Json.dll directly. I deleted the package folder and all project bin and obj folders. The recompile still can not fix it.
What can be done to fix this problem?
Have you also delete the NuGet.Config file in the packages folder? If you did it, Visual Studio will try to do the MSBuild package restore instead of Automatic Package Restore.
By default, the NuGet.Config file instructs NuGet to bypass adding
package binaries to source control. Automatic Package Restore will
honor this as long as you leave this file in place. Note that
NuGet.Config only has an effect when using Visual Studio to integrate
with Team Foundation Server (TFS).
You should also manually remove references in all your projects to the Nuget.targets file. The following article outlines in more details: https://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore
If you still can't fix it, try to use the Command-Line Package Restore

Referenced Dll's not found in Team Foundation Service (or: nuget packages not available on other pc)

when I create a build for the Team Foundation Service, I get all kind of reference dll's not found exceptions.
These references are added by nugget packages.
I've added the 'package restore' option on the solution which added 3 files in a .NuGet folder.
EDIT
When i got the solution from TFS on another pc, i got the same errors (missing dll's), so it's not only the TFS build service having problems.
The missing dll's are are missing files from installed nuget packages (some are part of the default VS template, Unity was a package i added later), which (the packages) are added on the first pc, but then are missing on the next pc (that's why i added the 'or' in the title of this question)
How can i get the Nuget added files on pc2 too?
I guess you've found a solution by now. I write this just to provide an answer for this question.
To have NuGet packages automatically downloaded on another PC, you need to enable NuGet package restore on build. You do this in two steps:
Right click the solution and select Enable NuGet Package Restore.
This will add a .nuget solution folder with NuGet.Config, NuGet.exe and NuGet.targets underneath it. These files should actually be checked in to source control, but the binary file is tiny. It will also modify the MSBuild scripts in all projects of the solution to import the NuGet.targets file to hook NuGet into the build process.
In Tools -> Library Package Manager -> Package Manager Settings make sure the option 'Allow NuGet to download missing packages during build' is checked.
This step must be done on all machines.
Now the BuildDependsOn property of all project build scripts should make the RestorePackages target in NuGet.targets kick in and download missing packages before you get build errors for missing references.

TFS does not build projects correctly

HI
I am trying to build my solution using TFS but it seems to skips the projects which have dependencies.
e.g Proj B depends on Proj A , then it builds only Proj A and not Proj B.
Also if i try to build the projects individually instead of the solution then it does not create the release folder. It says that the output path is not found.
Any help is much appreciated
thanks
Is the SLN file in question converted from an older version of Visual Studio?
I've found that sometimes, like when you upgrade from a VS2003 SLN file to a VS2008 SLN file, it fails in MSBuild (which is what TFS is doing essentially).
Try making a new SLN file in VS2008 (or whatever version you're using) with the same project and see if that fixes it...
If you right-click the solution, one option you'll have is dependencies. Make sure that the projects are correctly setup there, even though they may reference each other the dependencies on the solution itself may not be complete or accurate...and this is what MSBuild uses.
Have a look in the configuration manager and make sure that the build you are running has those projects selected to build.
It may be you are running the Debug configuration for your local build and then running Release on the TFS server and it's not configured the same.

Resources