What is the source of truth for NuGet package index? - nuget

I have a NuGet repo in Artifactory (version 7.27.9) hosting a few PowerShell modules packaged as .nupkg. I am using the following NuGet V2 API endpoint to browse my packages (I assume this is the package index) but am seeing packages that are inconsistent with what my Artifactory web GUI shows: https://my-artifactory.com/artifactory/api/nuget/my-nuget/Packages() (when I run Find-Module -Verbose I can see that this is the URL it is using to search for packages).
For example, one of the entries it returns is:
<entry>
<id>https://my-artifactory:443/artifactory/api/nuget/my-nuget/Packages(Id='Adlm-Utilities',Version='1.0.0')</id>
<title type="text">Adlm-Utilities</title>
<summary type="text">Test module</summary>
<updated>2022-04-26T18:39:29Z</updated>
<author>
<name>Me</name>
</author>
<link rel="edit" title="V2FeedPackage" href="Packages(Id='Adlm-Utilities',Version='1.0.0')"/>
<link rel="self" title="V2FeedPackage" href="Packages(Id='Adlm-Utilities',Version='1.0.0')"/>
<category term="NuGetGallery.OData.V2FeedPackage" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
<content type="application/zip" src="https://my-artifactory:443/artifactory/api/nuget/my-nuget/Download/Adlm-Utilities/1.0.0"/>
<m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">
<d:lastUpdated>2022-04-26T18:39:29</d:lastUpdated>
<d:Version>1.0.0</d:Version>
<d:Copyright>(c) 2022 Me. All rights reserved.</d:Copyright>
<d:Created m:type="Edm.DateTime">2022-04-26T18:39:29</d:Created>
<d:Dependencies></d:Dependencies>
<d:Description>Test module</d:Description>
<d:DownloadCount m:type="Edm.Int32">0</d:DownloadCount>
<d:IsLatestVersion m:type="Edm.Boolean">false</d:IsLatestVersion>
<d:IsAbsoluteLatestVersion m:type="Edm.Boolean">false</d:IsAbsoluteLatestVersion>
<d:IsPrerelease m:type="Edm.Boolean">false</d:IsPrerelease>
<d:Language m:null="true"/>
<d:Published m:type="Edm.DateTime">2022-04-26T18:39:29</d:Published>
<d:PackageHash>zZlILVNqiwQLnILs0X86XG93sxUug7bmlXX2SLE5JfZ5YCLklwB2B0LCbB8/f4wJjeQhd3yVo6yZIgDy6RWoDQ==</d:PackageHash>
<d:PackageHashAlgorithm>SHA512</d:PackageHashAlgorithm>
<d:PackageSize m:type="Edm.Int64">3787</d:PackageSize>
<d:ReleaseNotes></d:ReleaseNotes>
<d:RequireLicenseAcceptance m:type="Edm.Boolean">false</d:RequireLicenseAcceptance>
<d:Tags>PSModule</d:Tags>
<d:Title m:null="true"/>
<d:VersionDownloadCount m:type="Edm.Int32">0</d:VersionDownloadCount>
<d:Authors>Me</d:Authors>
<d:MinClientVersion m:null="true"/>
</m:properties>
</entry>
This package, Adlm-Utilities-1.0.0.nupkg, does not exist -- it did at one point, but I deleted it via the Artifactory web GUI. If I grab the URL from the src attribute of the <content> element (https://my-artifactory:443/artifactory/api/nuget/my-nuget/Download/Adlm-Utilities/1.0.0), and paste it in my browser to download it, I get a 404, confirming that this package does not exist.
I am seeing this behavior all throughout this package index -- there are tons of old packages that I have deleted that are still showing up in the index. I have emptied the Artifactory trash can, as well as recalculated the index on the my-nuget repo, and still the index doesn't change. Artifactory appears to be correct -- it is showing the correct packages in the GUI and when I recalculate the index, I can look in console.log and see that it is only processing the packages I can see. It seems that this NuGet index is completely separate from the Artifactory index.
Some questions I have:
Where is this /api/nuget/<repo>/Packages() endpoint getting its information? Is it the Artifactory database or some flat file on the VM?
Is there anyway to force this index to update?
Can packages even be removed from this index?
Is there a better way to delete packages from a NuGet repo? I pushed these packages using Publish-Module but there doesn't seem to be an inverse cmdlet to "unpublish" a module

Related

Artifactory's nuget repo with a path: it works for push but not for install

My %userprofile%\appdata\Roaming\nuget\NuGet.Config contains:
<configuration>
<packageSources>
<add key="rt1" value="https://my-server.com/artifactory/api/nuget/nuget-local" />
<add key="rt2" value="https://my-server.com/artifactory/api/nuget/nuget-local/rt2" />
</packageSources>
Now push works for both, but install works only with rt1.
nuget push My.Package.1.0.0.nupkg -source rt1 # works
nuget push My.Package.1.0.0.nupkg -source rt2 # works
nuget install My.Package # DOES NOT WORK IF I HAVE rt2 as source
OK https://my-server.com/artifactory/api/nuget/nuget-local/FindPackagesById()?id='My.Package'&semVerLevel=2.0.0 154ms
An error occurred while retrieving package metadata for 'My.Package' from source 'rt2'.
Failed to fetch results from V2 feed at 'https://my-server.com/artifactory/api/nuget/nuget-local/rt2/FindPackagesById()?id='My.Package'&semVerLevel=2.0.0' with following message : Response status code does not indicate success: 405 (Method Not Allowed).
Response status code does not indicate success: 405 (Method Not Allowed).
Is this expected behavior? It looks like nuget expects FindPackagesById() to be available on repo url for install operation, and it is failing on rt2.
Is there any way to use the path as a source, without creating virtual repo with Includes/Excludes config? Would jfrog nuget cli give me different behavior?
I found it was also asked in jfrog: https://www.jfrog.com/jira/browse/RTFACT-23310, but it was marked as Not a Bug without any explanation.
Someone filed an issue with Artifactory/JFrog and they closed it as "Not a Bug": https://www.jfrog.com/jira/browse/RTFACT-23310
So apparently using package paths is not supported when pulling from Artifactory as a nuget source (even though it is supported when pushing).

How to specify a package source for nuget

We are currently using SyncFusion for our solution at work for one of our solutions. In local every package are restoring but in VSTS it seem that it's having some difficulties to mix both syncfusion packages with official nuget packages.
I posted the entire log of the nuget restore on a gist here : https://gist.github.com/erickgirard/844f57d0f98f0cbea13d6ad4ddbde7e0
What I believe is that for every package in packages.config it's trying all sources (is there a possibility to specify a source for one package?)
Not quite sure of what are the solution here beside commiting the syncfusion dlls in the source control.
Here is the nuget.config file of the solution:
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<packageSources>
<add key="sync fusion nuget feed" value="http://nuget.syncfusion.com/aspnetmvc" />
</packageSources>
<packageRestore>
<add key="enabled" value="True" />
</packageRestore>
</configuration>
Here is an excerpt of the logs:
[...]
2017-10-16T16:10:33.6063822Z Acquiring lock for the installation of Swashbuckle.Core 5.5.3
2017-10-16T16:10:33.6123760Z Acquired lock for the installation of Swashbuckle.Core 5.5.3
2017-10-16T16:10:33.6123760Z Installing Swashbuckle.Core 5.5.3.
2017-10-16T16:10:33.6173723Z NotFound http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/Packages(Id='System.IdentityModel.Tokens.Jwt',Version='5.1.4') 97ms
2017-10-16T16:10:33.6173723Z GET http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/FindPackagesById()?id='System.IdentityModel.Tokens.Jwt'
2017-10-16T16:10:33.6453473Z NotFound http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/Packages(Id='Microsoft.Net.Compilers',Version='2.2.0') 562ms
2017-10-16T16:10:33.6453473Z GET http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/FindPackagesById()?id='Microsoft.Net.Compilers'
2017-10-16T16:10:33.6913056Z OK https://api.nuget.org/v3-flatcontainer/system.identitymodel.tokens.jwt/5.1.4/system.identitymodel.tokens.jwt.5.1.4.nupkg 143ms
2017-10-16T16:10:33.6913056Z Acquiring lock for the installation of System.IdentityModel.Tokens.Jwt 5.1.4
2017-10-16T16:10:33.6923050Z Acquired lock for the installation of System.IdentityModel.Tokens.Jwt 5.1.4
2017-10-16T16:10:33.6923050Z Installing System.IdentityModel.Tokens.Jwt 5.1.4.
2017-10-16T16:10:33.6923050Z NotFound http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/Packages(Id='Unity.AspNet.WebApi',Version='4.0.1') 103ms
2017-10-16T16:10:33.6923050Z GET http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/FindPackagesById()?id='Unity.AspNet.WebApi'
2017-10-16T16:10:33.6943020Z OK http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/FindPackagesById()?id='Microsoft.Net.Compilers' 49ms
2017-10-16T16:10:33.7092888Z OK http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/FindPackagesById()?id='Unity.AspNet.WebApi' 44ms
2017-10-16T16:10:33.7312690Z OK https://api.nuget.org/v3-flatcontainer/unity.aspnet.webapi/4.0.1/unity.aspnet.webapi.4.0.1.nupkg 170ms
[...]
2017-10-16T16:10:41.1345069Z Completed installation of System.IdentityModel.Tokens.Jwt 5.1.4
2017-10-16T16:10:41.1395038Z Adding package 'System.IdentityModel.Tokens.Jwt.5.1.4' to folder 'd:\a\3\s\Projets\packages'
2017-10-16T16:10:41.1425014Z Added package 'System.IdentityModel.Tokens.Jwt.5.1.4' to folder 'd:\a\3\s\Projets\packages'
2017-10-16T16:10:41.1455002Z Added package 'System.IdentityModel.Tokens.Jwt.5.1.4' to folder 'd:\a\3\s\Projets\packages' from source 'https://api.nuget.org/v3/index.json'
2017-10-16T16:10:41.3558804Z Completed installation of Swashbuckle.Core 5.5.3
2017-10-16T16:10:41.3578871Z Completed installation of Microsoft.TeamFoundationServer.Client 15.115.0-preview
2017-10-16T16:10:41.3578871Z Adding package 'Microsoft.TeamFoundationServer.Client.15.115.0-preview' to folder 'd:\a\3\s\Projets\packages'
2017-10-16T16:10:41.3588793Z Adding package 'Swashbuckle.Core.5.5.3' to folder 'd:\a\3\s\Projets\packages'
2017-10-16T16:10:41.4116910Z Added package 'Swashbuckle.Core.5.5.3' to folder 'd:\a\3\s\Projets\packages'
2017-10-16T16:10:41.4116910Z Added package 'Swashbuckle.Core.5.5.3' to folder 'd:\a\3\s\Projets\packages' from source 'https://api.nuget.org/v3/index.json'
2017-10-16T16:10:41.4116910Z Added package 'Swashbuckle.Core.5.5.3' to folder 'd:\a\3\s\Projets\packages'
2017-10-16T16:10:41.4116910Z Added package 'Swashbuckle.Core.5.5.3' to folder 'd:\a\3\s\Projets\packages' from source 'https://api.nuget.org/v3/index.json'
[...]
2017-10-16T16:10:56.8833741Z Running restore with 2 concurrent jobs.
2017-10-16T16:10:56.8853733Z Reading project file d:\a\3\s\Projets\DobermanHub.GFI.Functions\DobermanHub.GFI.Functions.csproj.
2017-10-16T16:10:56.9003673Z Restoring packages for d:\a\3\s\Projets\DobermanHub.GFI.Functions\DobermanHub.GFI.Functions.csproj...
2017-10-16T16:10:56.9153620Z Restoring packages for .NETFramework,Version=v4.6.1...
2017-10-16T16:10:57.0043336Z GET http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id='Microsoft.NET.Sdk.Functions'
2017-10-16T16:10:57.0203252Z GET https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.functions/index.json
2017-10-16T16:10:57.0992975Z OK https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.functions/index.json 85ms
2017-10-16T16:10:57.1122942Z InternalServerError http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id='Microsoft.NET.Sdk.Functions' 111ms
2017-10-16T16:10:57.1162923Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id='Microsoft.NET.Sdk.Functions''.
2017-10-16T16:10:57.1162923Z Response status code does not indicate success: 500 (Internal Server Error).
2017-10-16T16:10:57.1162923Z GET http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id='Microsoft.NET.Sdk.Functions'
2017-10-16T16:10:57.1332855Z GET https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.functions/1.0.2/microsoft.net.sdk.functions.1.0.2.nupkg
2017-10-16T16:10:57.1442827Z OK https://api.nuget.org/v3-flatcontainer/microsoft.net.sdk.functions/1.0.2/microsoft.net.sdk.functions.1.0.2.nupkg 10ms
2017-10-16T16:10:57.1762708Z InternalServerError http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id='Microsoft.NET.Sdk.Functions' 59ms
2017-10-16T16:10:57.1762708Z Retrying 'FindPackagesByIdAsyncCore' for source 'http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id='Microsoft.NET.Sdk.Functions''.
2017-10-16T16:10:57.1762708Z Response status code does not indicate success: 500 (Internal Server Error).
2017-10-16T16:10:57.1762708Z GET http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id='Microsoft.NET.Sdk.Functions'
2017-10-16T16:10:57.3411621Z InternalServerError http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id='Microsoft.NET.Sdk.Functions' 165ms
2017-10-16T16:10:59.6996347Z System.AggregateException: One or more errors occurred. ---> NuGet.Protocol.Core.Types.FatalProtocolException: Failed to retrieve information about 'Microsoft.NET.Sdk.Functions' from remote source 'http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id='Microsoft.NET.Sdk.Functions''. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 500 (Internal Server Error).
2017-10-16T16:10:59.6996347Z at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
2017-10-16T16:10:59.6996347Z at NuGet.Protocol.HttpSource.<>c__DisplayClass12_0`1.<<GetAsync>b__0>d.MoveNext()
2017-10-16T16:10:59.6996347Z --- End of stack trace from previous location where exception was thrown ---
2017-10-16T16:10:59.7006128Z at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
2017-10-16T16:10:59.7006128Z at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
2017-10-16T16:10:59.7006128Z at NuGet.Common.ConcurrencyUtilities.<ExecuteWithFileLockedAsync>d__2`1.MoveNext()
In our NuGet Server, we are maintaining multiple Feeds based on platforms and in NuGet site we are displaying friendly feed URLs. If you copy and paste those friendly URLs in any browser, it will redirect to actual Feed Link.
Friendly Feed URL:
http://nuget.syncfusion.com/aspnetmvc/
Actual Feed URL:
http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/
Your given below URL is incorrect hence it’s return 500 error while resorting the ASPNET MVC package.
http://nuget.syncfusion.com/aspnetmvc/FindPackagesById()?id=%27Microsoft.NET.Sdk.Functions%27
In your case, you must use actual feed URL instead of friendly URL.
http://nuget.syncfusion.com/nuget_aspnetmvc/nuget/getsyncfusionpackages/aspnetmvc/FindPackagesById()?id=%27Microsoft.NET.Sdk.Functions%27
Please follow the steps given in the below link.
https://www.syncfusion.com/kb/7609/how-to-install-syncfusion-nuget-packages-in-visual-studio-2017
Thanks,
Mathan Kumar

VSTS Automated Build NuGet Packager/Publisher

My package builds successfully and is uploaded to the Packages feed in VSTS however I can't seem to figure out how to edit the Description and Author of the package so that my set values show in the Package feed.
From what I read I put my content in the NuGet Packager under additional build properties and when I look at the log file I see this:
...NuGet.exe pack "...csproj" -OutputDirectory "..." -Properties Configuration=release;Description="My Description";Authors="Me";Owners="My Company"
From the documentation I believe I did this right(but clearly I did not). It does seem a bit confusing as to what goes in "Additional build properties" vs NuGet Arguments.
Again my goal is get the Description and Author that I set to be viewable from the NuGet Package Manager within Visual Studio.
You could create a package according to the .nuspec file.
Steps:
Generate .nuspec file for your project (command: nugget spec).
For example: (Include author and description token)
<?xml version="1.0"?>
<package >
<metadata>
<id>CommLib1</id>
<version>1.0.0.6</version>
<title>CommLib1</title>
<authors>$author$</authors>
<owners>$author$</owners>
<licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl>
<projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl>
<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2016</copyright>
<tags>Tag1 Tag2</tags>
</metadata>
</package>
Include this file to source control
Specify Nuget Arguments (token in step 1) of Nuget Packager build step
Update1:
In general, you just need to update AssemblyInfo.cs file of your project (Author=>AssemblyCompany; Description=>AssemblyDescription; Version=>AssemblyVersion), it creates package according to this data unless it can't retrieve metadata from your assembly (I have a project has this issue).
So, steps:
Make sure nuget could retrieve necessary metadata by creating package through nuget.exe command directly in your local/build machine (nuget pack [XX].csproj)
Create a build definition (1. Visual Studio Build 2. Nuget Packager with default value 3. Nuget Publisher)
If it's building the package then there are no problems with your NuGet Packager build step. Two things need to change though.
In order to specify properties like you are doing there MUST be a tokenized *.nuspec file in the same directory as the solution file with the same name and of course the *.nuspec file needs to be checked in to VSTS/TFS.
The token name for description can't be Description.
For more details on the *.nuspec file please see the solution here:
Nuget.exe pack WARNING: Description was not specified. Using 'Description'

specflow plugin with nunit and TFS build

I am in the middle of trying to get specflow UI tests working with TFS build and I am very very close.
I wanted to be able to run the same test on a number of browsers, and so after some research I found this:
http://www.baseclass.ch/blog/Lists/Beitraege/Post.aspx?ID=4&mobile=0
And it works like a dream for local test runs. the next step was to get this to call a selenium grid during a TFS 2010 build.
After getting the nunit community build task into my build template, I am now stuck with an error I can't seem to resolve. The build reports the following error:
Error: The system cannot find the file specified. Stack Trace: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at TfsBuildExtensions.Activities.CodeQuality.NUnit.RunProcess(String fullPath, String workingDirectory, String arguments) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 339 at TfsBuildExtensions.Activities.CodeQuality.NUnit.PublishMSTestResults(String resultTrxFile, String collectionUrl, String buildNumber, String teamProject, String platform, String flavor) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 394 at TfsBuildExtensions.Activities.CodeQuality.NUnit.PublishTestResultsToTFS(ActivityContext context, String folder) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 387 at TfsBuildExtensions.Activities.CodeQuality.NUnit.InternalExecute() in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Activities\CodeQuality\NUnit\NUnit.cs:line 299 at TfsBuildExtensions.Activities.BaseCodeActivity.Execute(CodeActivityContext context) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\Legacy\VS2010\Source\Common\BaseCodeActivity.cs:line 67.
however, this seems to be masking a deeper error as to me it simply says that nunit can't load a custom assembly. So I had a look through the binaries folder on the build server for the nunit logs, and sure enough in my test run .xml file I find another error:
System.Configuration.ConfigurationErrorsException : The type 'OpenQA.Selenium.Remote.RemoteWebDriver, Baseclass.Contrib.SpecFlow.Selenium.NUnit.SpecFlowPlugin' could not be found. It may require assembly qualification, e.g. "MyType, MyAssembly".
at Autofac.Configuration.ConfigurationRegistrar.LoadType(String typeName, Assembly defaultAssembly)
at Autofac.Configuration.ConfigurationRegistrar.RegisterConfiguredComponents(ContainerBuilder builder, SectionHandler configurationSection)
at Autofac.Configuration.ConfigurationRegistrar.RegisterConfigurationSection(ContainerBuilder builder, SectionHandler configurationSection)
at Autofac.Configuration.Core.ConfigurationModule.Load(ContainerBuilder builder)
at Autofac.Module.Configure(IComponentRegistry componentRegistry)
at Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry, Boolean excludeDefaultModules)
at Autofac.ContainerBuilder.Build(ContainerBuildOptions options)
at RegistrationForm.Tests.Acceptance.Features.UserRegistrationFeature.FeatureSetup() in c:\Builds\1\Testing\RegistrationForm - Nightly - Main\Sources\Testing\RegistrationForm\Main\RegistrationForm.Tests.Acceptance\Features\UserRegistration.feature.cs:line 0
From this I started to look at the path to the custom assembly. This is specified in the app.config file for the project (which is transformed during the build. I also checked to ensure the file is being transformed, and in the binaries directory on the build server it is). the relevant section of the file is this.
<specFlow>
<stepAssemblies>
<stepAssembly assembly="SpecFlow.Assist.Dynamic" />
<stepAssembly assembly="Baseclass.Contrib.SpecFlow.Selenium.NUnit.Bindings" />
</stepAssemblies>
<unitTestProvider name="SeleniumNUnit" />
<plugins>
<add name="Baseclass.Contrib.SpecFlow.Selenium.NUnit" path="..\packages\Baseclass.Contrib.SpecFlow.Selenium.NUnit.1.2.0\tools" />
</plugins>
Which works locally. I figured I just need to change the path in the transformed file. At first I assumed the working directory was the binaries directory so in the transform file I have this:
<specFlow>
<plugins xdt:Transform="Replace">
<add name="Baseclass.Contrib.SpecFlow.Selenium.NUnit" path="." />
</plugins>
The dll is in the same dir (binaries) so I tried ".", "", ".\" - none of these worked. So after thinking a little more and reading the errors more carefully I thought I needed to look in the Sources folder on the build server. The Dll is in the packages folder (nuget package restore), and so the path should be the same as I use locally. this didn't work either. So what about a path relative to the ".feature" file throwing the error? this simply needed an extra "..\" - still no luck.
So i am at a bit of a loss, I feel I have tried all the paths i can think of, but my knowledge of specflow plugins and TFS build is letting me down. can anyone give me any pointers?
But the initial error is basically saying the TFSs nunit support cant find a file when it calls CreateProcess, and as you say it works for local test runs, so is it as simple as NUnit isn't installed on the machine that is running the test for you?
I got there in the end!
So somewhere along the lines of setting this up I endded up with something like this in my app.config:
<component
name="IE"
type="Baseclass.Contrib.SpecFlow.Selenium.NUnit.RemoteWebDriver, Baseclass.Contrib.SpecFlow.Selenium.NUnit.SpecFlowPlugin"
service="OpenQA.Selenium.Remote.RemoteWebDriver, WebDriver"
instance-scope="per-dependency">
<parameters>
<parameter name="browser" value="InternetExplorer" />
<parameter name="url" value="http://192.168.1.3:4444/wd/hub" />
</parameters>
</component>
The problem (as it says in the error) is that it could not find OpenQA.Selenium.Remote.RemoteWebDriver. I belive I saw this in one of the examples I found on the bassclass page. After changing it to OpenQA.Selenium.IWebDriver everything worked fine, and nUnit was able to run my specFlow tests on my TFS 2010 build server. I did hit another snag in that when the build tried to parse the results, it tried to use MSTest 11 rather than 10 (prob because I was using VS 2012). However, this TFS machine was just a proof of concept and was a windows 2008 32bit edition running on Virtual PC on windows 7. (I could therfor not run 64bit, and so could not install VS2012 on my build server). I resolved this by creating a new environment variable for MStest 11 and pointing it at MSTest 10. The entire process now works perfectly.

Deploying PostSharp into a Source Repository with NuGet Package Restore

Is it possible to Deploy PostSharp into a Source Repository in conjunction with NuGet Package Restore?
I can get this working by committing the postsharp package, but that negates somewhat the value of the Package Restore feature.
Here’s what I did.
I was trying to set up postshap like so: Deploying post sharp into a source repo
I have set up nugget to use without commiting like so: Using NuGet Without Committing Packages to Source Control
I see this in my csproj
<Import Project="..\packages\PostSharp.2.1.6.13\tools\PostSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
(I re-ordered them to no avail)
And my build server (CC.net) reports the following errors:
D:\wwwroot\www.snip.co.nz\http\www.snip.co.nz.csproj (714,3):
errorMSB4019: The imported project "D:\wwwroot\www.snip.co.nz\packages\PostSharp.2.1.6.13\tools\PostSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
CacheAttribute.cs (8,7):
errorCS0246: The type or namespace name 'PostSharp' could not be found (are you missing a using directive or an assembly reference?)
…etc…
You currently (v2.1.6.13) have to fix the csproj to support Package Restore,
within the Import target element add the condition shown here:
<Import Project="..\packages\PostSharp.2.1.6.13\tools\PostSharp.targets"
Condition="Exists('..\packages\PostSharp.2.1.6.13\tools\PostSharp.targets')" />