I'm currently in the middle of upgrading out ASP.NET Application to .NET 4 Framework. The code compiles and our unit tests seem to run under the new .NET Framework without much problems. Our WaTiN tests however simply refuse to even start.
I've installed the Gallio 3.3 and 3.2 suites and neither succeeds in running the tests. 3.3 simply crashes when trying to discover the tests and 3.2 hangs when trying to execute the test. The output differs between the two versions, but bottomline is : neither work.
When looking at teamcity logs, I receive the following error output: http://pastebin.com/GNkQFfNr
This is with the latest version of both Watin and Gallio suite.
Has anyone been able to get this combination properly running under .NET4?
Gallio : 3.3
Watin : 2.1
.NET : 4.0
Buildagent : Windows XP 32bit
invoked through nant scripts
EDIT
Editing the awnser as some people asked for the details:
We installed the latest version from Gallio. First we tried to build it from source, but this seemed to be failing for reason, so we took the installer to get the latest version installed. We also downloaded the no-install package and placed that inside our SVN.
We then downloaded the source from WaTiN and compiled this ourselves against the .NET 4 Framework. Awe also included the source and the binaries in our SVN so the build agents have access to this.
Finally we stripped out the NCover from Gallio, as this version was not .NET 4 Compatible. We replaced this with PartCover and updated the nant scripts to invoke PartCover instead of NCover.
Related
I have a cross platform automation solution based on SpecFlow and NUnit 3.
This solution succeeds to run Web (Selenium) and Android (Xamarin.UITest) automated tests on Windows, unfortunately, it does not works on OS X in Visual Studio Mac.
When I use the command line NUnit console runner OR Rider (JetBrains IDE), tests seems to be working, but when I use VS Mac, it does not.
All my issues seems to be related to VS Mac, the first I had was because assemblies dynamically loaded by SpecFlow were not found.
Someone gave me a workaround on GitHub (TestRunnerSupportAssembly key to add in .csproj so that test runner can find assemblies).
And now that the assemblies are loaded, it is the App.config file which seems to be loaded but whose keys do not appear in AppSettings object.
Here is a part of the log I get from the IDE during test run :
Mono: Config attempting to parse: '/Users/.../Automation/AutomationMobile/bin/Debug/AutomationMobile.dll.config'.
I really think the issue is because of the test runner used by VS Mac, but I can't find how to configure it appropriately.
PS : I cannot migrate to .NET core, because few assemblies does not support it (Xamarin.UITest for instance).
I have tried to run the out of the box Blazor application to try out C# WebAssembly. I am running into issues when trying to run it different ways. I have also tried to hack the runtimeconfig.json according to this https://github.com/dotnet/cli/issues/7543
Running IIS Express
Running BlazorApplication1
The program '[42032] dotnet.exe' has exited with code -2147450749 (0x80008083).
Running in command line
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '2.0.0-preview3-25512-01' was not found.
- Check application dependencies and target a framework version installed at:
\
- Alternatively, install the framework version '2.0.0-preview3-25512-01'.
You need to have the 2.1 preview of the .net core framework installed for Blazor to work: download here
After following several blogs detailing how to get xUnit working with Team Services Build vNext:
http://tech.trailmax.info/2014/01/run-xunit-in-hosted-team-foundation-service/
Running unit tests in TFS/VSO Build vNext using xUnit adapter
http://www.donovanbrown.com/post/2015/06/15/how-to-run-xunit-test-with-vnext-build
None of which worked for me. From examining the build logs I get the following warnings for each of my test assemblies.
--------------------
Warning: [xUnit.net 00:00:00.1644156] Exception discovering tests from CHO.SAM.Business.Test: System.BadImageFormatException:
Could not load file or assembly 'c:\_Work\473cef3c\CHO\CHO.ALL\Tests\CHO.SAM.Business.Test\CHO.SAM.Business.Test\bin\Debug\xunit.execution.desktop.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
--------------------
Has anyone seen this before? and if so did you figure out a solution?
My thoughts are; my test projects are compiled using .NET Framework 4.6, I was wondering if this could be causing the problem? If so I would have to move over to nUnit or something as I don't feel it's right to change the compilation just to use a single test framework.
Add "/Framework:Framework45" to "Advanced/Other console options" (to run under .NET 4.5)
or
Add "/Framework:Framework40" to "Advanced/Other console options" (to run under .NET 4.0)
or
Change "Advanced/VSTest version" to "Visual Studio 2013" (to run under .NET 3.5)
This error is normally caused by a x64 compiled assembly running on x86 test runner or vice versa. Check the solution build configuration that is being run.
I had this same issue. Adding a UI test did not fix it for me. I found two alternatives that work:
use .net 4.5
OR
Set the advanced options of the VSTest task to use 2013 instead of 2015.
Hopefully this will be fixed soon.
In the end, I added a Visual Studio Coded UI test project and removed all it's contents (a class), it's empty!
I'm assuming it's added a reference or something that the build server felt it needed.
I am now getting my unit tests discovered, running and with code coverage.
Wierd!
It works, but I don't know why...
I ran into this issue when using a .Net Core class library to run my xUnit tests against a .Net Core Web Project (.Net Framework). What solved the issue for me was to change the default processor for running test to X64 in VS2015 via:
Menu Bar -> Test -> Test Settings -> Default Processor Architecture -> X64
This solution was posted by #RehanSaeed here https://github.com/dotnet/cli/issues/3103
I have a Build server which has TFS 2010 Build Service installed. I have 2 Build Agents and 1 Controllers configured. One of our projects have been converted to Visual Studio 2012.
I found out that .NET framework 4.5 comes with new version of MSBuild which is version 4.5.
I installed .NET framework 4.5 on the Build Server because prior to installing it every time the project was built I kept getting the following error:
"Solution is of version '12.00' which is not currently supported".
After installing .NET 4.5, I still run into the same issue.
How could I go about resolving this?
Do I have to configure the Build Agent to use the new MSBuild 4.5 in order to build this particular project or do I set something in the projects solution file itself? If so how?
I would really appreciate if somebody could assist me with this please?
Try install vs2012 on the build server, while i don't believe it's strictly needed it's the easiest way to get all the requirements installed.
We have installed VS2012 on the build agent. Interestingly when I RDC to the build agent and then run msbuild from the command line everything works fine. So the issue looks like it happens before we even get to MSBuild.
Using TeamCity 6.5.1
NUnit version 2.5.10
Win2008 x64
Project is using .NET 4.0
Trying to execute the built-in TeamCity NUnit test runner, I receive the following error:
NUnit error running tests in 'E:\TeamCity\LocalBuildAgent\BuildAgent\work\698a8f459eac8cd9\MyProject\bin\Release\MyProject.Tests.dll' assebmly
System.BadImageFormatException: Could not load file or assembly 'E:\TeamCity\LocalBuildAgent\BuildAgent\work\698a8f459eac8cd9\MyProject\MyProject.Tests\bin\Release\MyProject.Tests.dll' or one of its dependencies. This
assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
My stack is pretty much identical to yours...so, I am going to take a shot in the dark here.
If you go into the Build Step you designated in Team City for running NUnit and find the .NET Runtime section and make sure Platform is set to "auto(MSIL)" and most importantly check to make sure version is set to v4.0.
I have seen your exact error when attempting to run unit tests for a 4.0 project against the 2.0 framework setting.
If it isn't that, I would suggest checking directory permissions and that the System or Network Service accounts which I think team city runs on (unless specified otherwise) can access the directory that your tests.dll resides in.