Closed czf closed 2 years ago
I have the same issue with bitbucket pipelines, any solution to this yet?
I have the same issue with bitbucket pipelines, any solution to this yet?
I ended up using an Assembly Resolver as a workaround.
private const string LINUX_EXTENSIONS_PATH = "/usr/share/dotnet/shared/Microsoft.AspNetCore.App/";
private const string MACOS_EXTENSIONS_PATH = "/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App/";
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
string extensionsPath = RuntimeInformation.OSDescription.Contains("Linux") ? LINUX_EXTENSIONS_PATH : MACOS_EXTENSIONS_PATH;
string filePath = extensionsPath + _runtimeVersionDirectory + "/" + args.Name.Substring(0, args.Name.IndexOf(',')) + ".dll";
if (File.Exists(filePath))
{
var assembly = Assembly.LoadFile(filePath);
_outputHelper.WriteLine("found: " + assembly?.GetName()?.Name);
return assembly;
}
return null;
}
As we stopped maintaining the SpecFlow+ Runner (https://specflow.org/using-specflow/the-retirement-of-specflow-runner/) I am closing this issue.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
SpecFlow Version
3.9.8
Which test runner are you using?
SpecFlow+ Runner
Test Runner Version Number
3.9.7
.NET Implementation
.NET 5.0
Project Format of the SpecFlow project
Sdk-style project format
.feature.cs files are generated using
SpecFlow.Tools.MsBuild.Generation NuGet package
Test Execution Method
Command line – PLEASE SPECIFY THE FULL COMMAND LINE
SpecFlow Section in app.config or content of specflow.json
No response
Issue Description
dotnet test.csproj --no-build --verbosity=normal
Running tests in a TeamCity linux agent an exception is thrown because the Microsoft.Extensions.Configuration.Abstractions assembly can't be found. When I run the cli dotnet test on my windows machine the assembly is found.
I noticed in the reports log on my windows machine the runtime directory(C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App) is explored
On the Team City Linux agent the runtime directory is not explored.(/usr/share/dotnet/shared/Microsoft.AspNetCore.App)
Both environments have the same Microsoft.AspNetCore.App 5.0.11 runtime installed
Steps to Reproduce
I can't reproduce outside a TeamCity agent. The same project works on my windows development machine. A teammate using a mac also has this exception when running the tests
Link to Repro Project
No response