-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' #295
Comments
If this is just some binding redirect issues, it will greatly benefit from increased logging with information which test assembly could not be loaded, since that alone greatly speedup troubleshooting. I hit similar issue in the past where binding redirects was required by the test. |
Okay... you might want to enlighten us how one would do this :) |
To get more logs from the CI pipeline, could you set If you could repro this locally using vstest.console, then it would also help to enable vstest.executionengine*.exe.config logging. Here is how you can enable that. I think we need to add a troubleshooting section in testfx-docs to help get more logging. |
Added docs for collecting traces in CI task here: https://github.com/Microsoft/vstest-docs/blob/master/docs/diagnose.md#collect-trace-in-vsts-ci-vstest-task |
Thanks for the troubleshooting guide to collect detail trace. I will try to get more logs and post back later. |
I enabled system.debug. 2017-10-31T21:44:42.7837155Z Microsoft (R) Test Execution Command Line Tool Version 15.0.26929.2 |
@northtyphoon : Can you check which version of System.IO.dll is present in TestRun folder in both machine(one with VS installed and build machine) and let us know. Also, instead of hard-coding the assembly binding redirects in app.config, can you add this in your *.csproj
This will generate a *.dll.config which will have the appropriate assembly binding redirects. See if things work for you after this change. |
@JayJanarthanan I have two different Test-Projects both with automatic binding redirect.
One works fine, one has the error mentioned above
|
@Mertsch : Can you please share repro projects with us? |
@jayaranigarg No I can not, but I found the root cause for this issue. I have a fairly complex solution with a lot of dependencies on other projects and frameworks, like the .NET Standard 2.0 library and EF Core (from .NET Framework 4.6.1 projects) and the But whenever I specify any The |
@jayaranigarg I was now able to nail down the issue So what is the issue?In my demo I have referenced a .NET Standard 2.0 library https://www.nuget.org/packages/fm.Extensions.Common/ If you now specify any |
@Mertsch : Can you move to latest Visual Studio Preview and see if it works for you... |
@jayaranigarg No, I will stay with the release version (15.4.2), but report back as soon as 15.5 is out |
I have ran into this exception too on our build server and local when not using resharper test runner. .NET Core 2.0 project targeting net47. TestFramework and TestAdapter at 1.2 Any thoughts? |
Ok, so auto binding redir. fails to add System.IO into the resulting app.config in output folder <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
Updated to 15.4.4, no dice |
@AndersMalmgren : Can you please explain your scenario in detail and share your repro project with us? |
We have the attribute, if I add DeploymentItem(@"System.IO.dll") it works. Is this by design? |
My workaround above works on my machien, but when build server is building and running tests I get Error: An exception occurred while invoking executor 'executor://mstestadapter/v2': Method not found: 'System.String Microsoft.VisualStudio.TestTools.UnitTesting.IgnoreAttribute.get_IgnoreMessage()'. |
I thought I had created a repro, net47 target platform plus DeploymentItem attribute, the repro fails inside our sln, but when I move the repro to a stand alone blank sln it does not fail anymore. So there is a third unknown factor here |
@AndersMalmgren : What do you mean by ".NET Core 2.0 project targeting net47" ? Did you mean that you created a .net core test project and changed the target framework to net47 OR you created a .net core test project and multi-targeted it to netcoreapp2.0 and net47 ?
Why exactly are you trying to run your tests from a different location(i.e. Out folder) and why not from bin/Debug? I think there is some confusion in the concept of |
I'm not trying to run it outside of bin/debug. mstest does that when it detects a DeploymentItem attribute. But if I create a blank solution and add a .net core test project targeting net47 I do not get the same behavior. Then its run under bin/debug and everything works. Its a third factor at play which I cant find. |
@AndersMalmgren : Instead of using DeploymentItem attribute in your solution, can you instead set Can you edit your csproj (i.e. .net core test project targeting net47 , the one mentioned in above comment), and let us know what value is present in value tag ? |
@jayaranigarg The DeploymentItem attribute is no longer needed since it run correctly under bin/debug. So it solves my problem (DeploymentItem was needed with the old mstest runner). But it seems you have a bug. If DeploymentItem is present, it runs under "Out" instead and alot of files are not copied. Not only System.* but others too. Like my screenshot above suggests. I will check in my removal of DeploymentItem and see if it runs also on our build server agent (visualstudio.com) |
Nope, it works on my machine, but not on the build agent
|
I want to rate this up as this is preventing us from running unit tests on some machines. We have a test project which references a dotnetcore 2.0 assembly, along with other dotnet fw 4.6.1 assemblies. Is there a solution for this problem? Anything to solve this assembly redirect thing? It seems there is another addition to the DLL hell :) |
As a senior system architect I can tell you this @jayaranigarg, when a SDK steals hours of a dev's time something is fundamental wrong with the design of it. And it seems many are coming here, you need to make sure this errors is fixed, or provide better log info, or make sure in other ways people do not spend hours and hours on it. |
@JP-CZ : Did you try adding lines mentioned in this comment in your *.csproj #295 (comment) Do you also have [DeploymentItem] attribute on your tests? If so, then instead of using DeploymentItem attribute in your solution, can you instead set If possible, can you share a repro project with us? |
@AndersMalmgren : Thank you for your feedback. We will surely try to improve upon it. |
Yes we added these lines in all of our projects. It clearly caused by the DeploymentItem attribute on the test method. This worked until now. Problem is we have many tests using this attribute to provide test data during test execution. Is this pattern no longer supported? Is unclear to me how this attribute effects what kind of files are deployed or where tests are run. |
@JP-CZ : Until when was this working for you and after what change/upgrade did this stop working? Normally, tests are ran from bin/Debug folder. If you want some of your project files to be dropped in bin/Debug, then simply setting
|
@jayaranigarg: you keep telling us either 1) not to use DeploymentItem or 2) that it's needed when you want to sandbox your tests... but when DeploymentItem is present anywhere in the test suite, the entire suite is unusable due to the binding issues. This is not just a documentation issue, there is a bug that needs to be fixed. There are thousands of test suites out there using DeploymentItem that are upgrading to the new project format and starting to pull in .NET Standard dependencies. Due to no fault of our own, they simply blow up with these obscure errors after the upgrade. I hope that is not an acceptable outcome to your team! |
@tfabraham : Apologies for the inconvenience. Let us dig deeper in this and figure out a better solution/fix for this issue. |
I just encountered this issue as well. 1.5.5 VS and 1.3.0-beta2 of the test adapter\test framework |
Same issue solved by using as reference
Or solved by uninstalling package
|
So, is there a work-around so we can use the 1.3.0-beta2 version? I have the same issue after trying to upgrade my project to this version of Framework and Adapter packages. Upgrade did generate a bunch of binding redirects, but they don't seem to help the issue. |
Hmm, removing the bindingredirects seems to work as a work-around. |
Workarround:
|
The problem of binding redirects getting added is similar to issue #241 . We are following up with the Nuget team on this on the fix to be done. There's another issue when the deploymentitem attribute is used in which we do a selective copy of the dlls. We will fix that issue by copying whatever is present in the output location of the test source. |
There are two issues in this case. For more details please refer to the issue on the nuget repo. 2 -> The set of dlls being used is subset of the ones used from bin/debug. We have a PR which will copy the content of bin/debug to the test deployment folder #391 |
I was able to solve this in my project by forcing Visual Studio to not use testhost.x86.exe To do this,
If you run vstest.console.exe by command-line you can send /Platform:64 |
@AndersMalmgren @tfabraham Please let us know if the provided workaround helps. |
hi thanks for your support,
i cant get back with a feedback soon for a uncertain time ....
sorry for that
i leave a task for me in my list
kr ewald
Freundliche Grüße
i. A. Ewald Stricker
Software Engineer Informationstechnologie Eigenentwicklung
Daten, Modelle & Handel (C-TIHD)
EnBW Energie Baden-Württemberg AG
Durlacher Allee 93 · 76131 Karlsruhe
Telefon +49 721 / 63-15429
Mobil +49 174 / 3005967
mailto: [email protected]
www.enbw.com
20.000 Mitarbeiter. Ein Versprechen: Wir machen das schon.
www.enbw.com/WirMachenDasSchon
EnBW Energie Baden-Württemberg AG
Sitz der Gesellschaft: Karlsruhe · Amtsgericht Mannheim · HRB Nr. 107956
Vorsitzender des Aufsichtsrats: Lutz Feldmann
Vorstand: Dr. Frank Mastiaux (Vorsitzender), Dr. Bernhard Beck,
Thomas Kusterer, Dr. Hans-Josef Zimmer
Am 04.06.18 um 10:47 schrieb Shiva Shankar
@AndersMalmgren @tfabraham Please let us know if the provided workaround helps.
…--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#295 (comment)
|
I'm hitting this issue as well in VSTS. All my projects use the .NET Core project format. PackageReference is used everywhere. The one project that fails is the one with |
This caveat should be documented here, the first search result for |
Wasn't running tests in VS test runner due to "An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'System.IO," Since we introduced DeploymentItem, we were impacted by microsoft/testfx#295
Added runsettings needed to run tests locally in VS2019 (due to presence of DeploymentItem and github.com/microsoft/testfx/issues/295 )
According to microsoft/testfx#295 the use of DeploymentItem tag should be reserved for special folder scenarios, and it resulted in most tests not being run on local and remote machines.
The testing behaviour of net47 has changed and there were outstanding issues of local run See microsoft/testfx#295 and https://github.com/microsoft/testfx-docs/blob/master/RFCs/009-DeploymentItem-Attribute.md [DeploymentItem] should not be used anymore in VS2019.
* Test added for Radian Parameters over PI in value * Updated MemoryModel package to handle radian conversion factors correctly Github xBimTeam#92 issue * Fixing issue xBimTeam#145 using filtering of representation items instead of finding first only * Some corrections for fix xBimTeam#145 Evaluation wasn't triggered because there was no consumer of stream * Fix for imprecisely defined planar wires github issue xBimTeam#73 Fix for SurfaceBaseModels being defined as multiple solids * Extruded area solids with compound profiles treated to return a solid set * Fixing issue xBimTeam#158 Second operand has never been added to difference build chain. Refactored IfcBooleanClippingResult to XbimSolidSet conversion. * Experimental: Changed ProjectTarget to 8.1 which should support Win 7SP1 clients * Added targetver to set WINVER as per https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=vs-2017 This is to support Win 7SP1 runtimes. * Update azure-pipelines.yml for Azure Pipelines Removed tests * removed target.h * Updated Nuget dependencies * Geometry engine unreferenced after tests completed * Workaround for boolean precision removed xBimTeam#166 * Fix for excessively large solid extrusions xBimTeam#160 * Fix for Ifc4 Add2 IfcTriangulatedFaceSet not rendering xBimTeam#167 * Fix for inaccurately defined IfcPolyloops that are not planar * Faceted Face set re-implemented to support tolerances better * Threading Model changed to avoid race conditions, boolean cut ops optimised for non-intersecting arguments * Composite curve reimplemented to correctly handle polylines as edges * IndexedPolyCurve implemented as curve * Fix for orientation of trimmed composite curve segments that are reversed * IfcSweptDiskSolidPolygonal fixed for closed directrix. XbimWire trim fixed for incorrect parameterisation * Composite Curve as wire added * IfcSectionedSpine fixed incorrect orientation error * Non-Intersecting cuts not returning the body shape resolved * Erro in booleans caused by Solids created from two coincidental faces fixed * Trimming of compound curve wire fix * Support for IIfcPolygonalFaceSet commenced * Support for 2D Polylines as curves added * Closed Shell chnaged to allow faulty solids with zero volume * Undone zero volume closed shells * Support for IfcPolygonalFaceSet completed. Very large facesetsare meshed rather than OCCed to prevent extremely slow performance * Reinstate tests now stabilty issue fixed * Closed Seep for swept disk solid fixed * Removed last traces of the large file * Adding axis tags to logging output for convenience * Adding fix for zero grid bounding box in CreateGrid assuming that the bounding box has a zero Z-extent. Does this hold? * Fix for unsupported curve type issue xBimTeam#180 * SweptDiskSolid fixed to align sweep with directrix direction * Interval Points for Wire fixed to include last point Composite curve wires now allow partial curves where segments are badly specified, a warning is issued rather than a failure error * Support for composite curves containing multi-edge segments added * Continue IfcGrid construction on exception * Fixing pipe maker tolerance issue * Half Space solid reimplemented with OCC MakeHalfSpaceSolid Polygonally bound half space amended to construct semi-infinite prism Fuzzy value for booleans increased to 6*tolerance Max faces to sew increased to 3000 * Grid creation fixed for errors on building lines with near precision thickness * Polygonal bounded half space corrected for potential boolean hangs with large extrema. Edge start and end points fixed to handle null vertices * Empty profile definition handled, polygonally bounded half space extrusion limited to prevent booleans hanging, compositve curve creation handles incorrect reverse segment definition * References update to Master Nuget dependencies Warnings fixed * No change * Minor readme update for VS versions * Added extra tests to help with failing CI test * Updated to 5.1 RTM essentials * Added changelog for 5.1 * Update build for 5.1 * Fixed changelog typo * Added changelog for 5.1 * Update build for 5.1 * Fixed changelog typo * Updated to 5.1 version data. Removed FileVersion so stamped by build * Updated to latest pre-release 5.1 dependencies * Updated latest RTM dependencies (with fileversions) * Updated 5.1 dependencies (xBimTeam#187) * Updated latest RTM dependencies (with fileversions) * Release 5.1 with 5.1 AssemblyVersion (xBimTeam#188) * Added changelog for 5.1 * Update build for 5.1 * Fixed changelog typo * Updated to 5.1 version data. Removed FileVersion so stamped by build * Updated to latest pre-release 5.1 dependencies * Updated latest RTM dependencies (with fileversions) * Confirmed release number * Regression causing incorrect clipping of HalfSpaceSolids fixed * Partial fix for incorrectly parameterised Polyline trims, further work is required to correctly implement Composite and Polyline curve trims when the BIM authros start to correctly write out the parameter values * Update README.md * Update README.md * Update README.md * Update README.md * Extended CI build timeout from default (60 minutes) to 120 minutes * Trying to fix pipeline with explicit definition of the job name * Trying to fix pipeline with extended timeout * Trying to fix the pipeline * Creation of solid sets from IfcPolygonalFaceSet added * Create Method for IfcPolygonalFaceSet amended to respect closed shells * Updated Essentials to Release * Attempt to fix large coordinates by reducing them and only keeping the transformation. * Updated Tessellator * Updated tessellator fixes shape bounding box position. Fixed transformation of the product bbox for region computation. * Updated Essentials * Added explicit test runsettings to help with failing tests * Update azure-pipelines.yml for Azure Pipelines Add runsettings * Refactored tests to use paths relative to deployed items. * Only deploy the native DLL for the current platform Means that consumers only get the native DLL appropriate to their current platform build (x86/x64) Fixes xBimTeam#216 * Better management of trims for IIfcSweptDiskSolid Typically used for rebars. * Tests was expecting wrong number of faces. * Resumed caching to help see files in Xplorer. When /caching is issued as parameter, the files are persisted as in xbim format so they can be seen in xplorer to check the results of meshing. * Tolerant of missing Z coordinate for some 3D pts. * More cases of Z missing tolerance. by code analysis, given a bug with unusual IFC files. * Cutting wires of IIfcCompositeCurve only if needed * Closed profile definitions with no outer profile caught and ignored * Fix for OCC infinite loop in ShapeHealing Time out added to ShapeHealing and Boolean Performs * All shape healing functions protected with a timeout * Fixed local tests runs Wasn't running tests in VS test runner due to "An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'System.IO," Since we introduced DeploymentItem, we were impacted by microsoft/testfx#295 * Copy both native files when building for AnyCPU Broken fixing xBimTeam#216 * Added Test for Advanced Brep failure * Added additional guard to be more tolerant when processing models without valid Contexts supplied. Should address xBimTeam/XbimWindowsUI#94 * More graceful handling of representations without a ContextOfItems. These are in violation of the specs but we should support them better. E.g. 2x3_Arboleda_Bldg-Arch.ifc * Going for green. Ignore an unimplemented test in this branch
Description
The test passed in Visual Studio. However, the test failed in the build machine as the following error.
An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies
I also notice if I manually removed TestAssembly.dll.config from the output folder, the test started to pass in the build machine.
Steps to reproduce
Expected behavior
Actual behavior
Environment
Package version of MSTest:
"MSTest.TestAdapter" Version="1.2.0"
"MSTest.TestFramework" Version="1.2.0"
The text was updated successfully, but these errors were encountered: