I am working on Visual Studio for Mac.
I am using test project with
MSTest.TestAdapter
MSTest.TestFramework
The project target is .NET Framework 4.6.1
(I need .NET Framwork to use Xamarin.UITest)
I can run this test library in the IDE by right clicking the project and selecting "Run Item".
How can I run those tests via terminal on a Mac?
It's not working with:
dotnet test
because it is not .NET Core.
On windows there seems to be a MSTest.exe. I couldn't find it on the mac via the "which" command.
Is there a way to start this test on mono with an executable that runs the test adapter?
Like a mstest equivalent to nuint-console on a Mac.
Edit: The question: How to run Mstests on a Mac? doesn't work for this problem because (see above) the tests aren't able to run under .NET Core. They are targeting the .NET Framework.
Related
I'm trying to figure out the differences between running/building a .Net core project using Visual Studio and the CLI, i.e. what process does Visual Studio follow when running the project?
I spent half a day yesterday debugging an issue where a static web resource could not be found (404) when I ran the project (both F5 and Ctrl+F5) using Visual Studio - both Debug and Release configs using both IIS Express and Project launch options - only to discover that the problem does not occur when I run the exact same project using VS Code's debugger (F5 or Ctrl+F5) or the CLI (dotnet run) directly. And today I wasted yet another 3 hours when I received a new build error message when building using VS, but the same project built and ran 100% using the CLI and VS Code...
I have a clean development environment with only one SDK that was installed along with VS, so they are both using the same SDK.
Given, I am playing around with .net5.0, so I'm using the latest preview build of VS (Version 16.8.0 Preview 2.0), but as far as I'm concerned, there should not be ANY differences when running a project using VS and the CLI. Unfortunately I cannot replicate the same issue using the stable build since both the problems are related to .net5.0 features (Scoped Styles and Blazor WASM).
Could someone please enlighten me on the steps that VS takes when running a .Net Core Web project? I KNOW it is not simpy using dotnet run as one would expect, so I would like to get as much info before I log yet another tooling issue with the dotnet people...
Any reply would be appreciated.
I have a test scenario where i want to validate the 4.5.2 version .net framework is being installed on a fresh windows environment (Win7, 8.1 and 10 - both 32 and 64 bit) along with the .exe which is being installed (Installation being one of the critical test scenario). I did the scripting in MS CodedUI Test. I want this script to be distributed on different machines. For this, I am using Test Controller and Agent setup. I am using VS2015 and TestAgent 2015. As Test Agent 2015 comes with .NET 4.6, my script is getting failed. Can i use any older versions of test agent to accomplish this?
Surely, the installer should fail if 4.5.2 is not available on the target? Then there is no need to use CodedUI to validate it.
I will try to explain this as clear as I can
I want to fully understand how MSBuild multitargeting works.
I have read several articles from Microsoft and I think I understand the basic but I want to be sure I am not missing anything.
According to Microsoft:
By using Visual Studio, you can compile an application to run on any one of several versions of the .NET Framework. For example, you can compile an application to run on the .NET Framework version 2.0, and compile the same application to run on the .NET Framework version 4. The ability to compile to more than one framework is named multitargeting.
Visual Studio runs under the most current version of the .NET Framework that is installed on the development computer.
http://msdn.microsoft.com/en-us/library/ee395432.aspx
So do this mean that Visual Studio always calls MSBuild from the latest framework installed? assuming Visual Studio 2010 is installed, it will always call: %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe when building any project targettting any .Net Framework version right???
If yes, then the ability to target old .Net Framewrok versions is based on the ToolsVersion and/or TargetFrameworkVersion properties right???
If yes again, it would mean that just installing the latest framework (and also the older frameworks but not installing visual studio) in my Continuous Integration box, I could point to build always any solution to: %WINDIR%\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe and just specify the ToolsVersion argument (if required, since each project can have its own target version specified in the TargetFrameworkVersion which it would cause to target an older .Net Framework version).
Following this I think my CI box would be building like Visual Studio does. Am I right? What am I missing? Is there a way to be completely sure?
I did a quick test, and I think it works :p the projects are being built according to the .Net Framework specified but like I said I want to be sure I am not missing anything.
Any thoughts?
BTW:
The simple reason to want to do that is because I have several custom MSBuild scripts that are reusable accross projects, but some of the functionality in these scripts require MSBuild 4.0 and also I have several MSBuild tasks built on top of the framework 4.0 so if I have for example a solution targetting the Framework 2.0 and I try to build it using: %WINDIR%\Microsoft.NET\Framework\v2.0.50727\MsBuild.exe I get MSBuild errors trying to load my custom targets
Yes, you've got it mostly correct. Calling MSBuild from the 4.0 directory will do the correct thing against previous versions. They only thing I wanted to add was that 3.5 must be on the box to actually build projects targeting 2.0, 3.0 and 3.5.
This page here: http://msdn.microsoft.com/en-us/library/bb822049.aspx calls out the what versions Windows comes with what version of the framework pre-installed.
I have a VS 10 project using .Net 4.0 and I use lots of stuff that do require 4.0. I created a VS Setup project added the primary output from my project and built it. I then installed it and everything worked fine. A few days later I am ready to do a new build so I rebuild my project and then the setup project. Now when I run the msi it tells me that .Net Framework 4.0 is required.... I figured I screwed it up so I just create a new setup project, and that works fine. But again a few days later (restarted VS in there probably and maybe even the computer) I rebuild and get the error telling me that .Net 4.0 is required. I did it a few times just to verify and it consistently happens and I cannot figure out why.
The project I am building and installing has a windows service that is set as the startup project. I will switch that to a console app object for local testing purposes and build and test the project (not the setup project). This is the only thing I can think of that may be impacting the build, but again, I cannot figure out why.
Any help is appreciated.
This error message is thrown when the Launch Conditions in the Setup Project aren't met.
Go to View > Editor > Launch Conditions
Change the .Net Framework version value to
match the version your setup project
is compiled into. By default, the 2010 setup and deployment project condition is set to .NET 4.0 Client Profile.
I have the Target Framework set to 2.0 on my windows application, yet when I try to install my app on the server, after publishing it through VS 2008, it is trying to install .Net 3.5 on the server.
I do not want to install 3.5 on my server.
When I copy the files from my local /bin/debug/ to the server and double click on the exe, nothing happens. On my local machine, my app runs.
How can I make this app run on the server without it needing the .Net 3.5 framework?
Do any of your dependencies require .NET 3.5? Do you have anything in any config files which might require .NET 3.5?
I suggest you take a copy of what you've got for safekeeping, and then cut it down to the very smallest app which demonstrates the problem. In fact, you might want to start from scratch with a "no-op" app and see whether that has the same behaviour.
Check unused references, perhaps? Are you actually getting an error about the 3.5 framework?
Try building the application in release mode and deploy it to the server. You will need to grab the application from the /bin/release folder instead of the /bin/debug folder.
Also, check the target framework under the application section of the project properties.
If you're using Visual Studio to build your setup project, open the setup project's properties and look through the settings. One setting says which .Net version will be demanded by the installer package. You have to set that; it doesn't inherit from known properties of your other projects.