Comments (6)
That did the trick - maybe worth calling out in some documentation somewhere? I originally just copy-pasted from the samples in the blog post.
Good idea, it's in the note box under the code sample https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-mstest-sdk but looks like is not super clear, thanks for the suggestion.
from testfx.
That did the trick - maybe worth calling out in some documentation somewhere? I originally just copy-pasted from the samples in the blog post.
from testfx.
TODOs:
- Update doc to make it clearer that
global.json
can be used and provide a full example - Make it clear this is the recommended pattern
- Update SDK sample to add the global.json case
from testfx.
@martincostello I will move on this ticket as completed as the docs and samples have been added/edited.
from testfx.
Somehow allow the SDK to be loaded/referenced without an explicit version number by loading it from the package reference (e.g. from ).
Hi @martincostello, the MSBuild sdk versioning doesn't allow the usage of the NuGet Central Package Version Management
As you can see here https://github.com/microsoft/testfx/tree/main/src/Package/MSTest.Sdk/Sdk an MSBuild SDK is a bunch of props/targets that we compose (for instance this is the main file https://github.com/microsoft/testfx/blob/main/src/Package/MSTest.Sdk/Sdk/Runner/ClassicEngine.targets).
So it's not easy have 1 version for everything because the imports will import more packages with different versions. So our 3.1.1 sdk actually is the "version" of MSTest from feature perspective but it's composed by more packages from different part of the platform and with different versions. For instance the new testing platform(https://github.com/microsoft/testfx/blob/main/docs/testingplatform/Index.md) that empower the runner is at the moment at version 1.1.0.
The only way at the moment to centralize the version at solution level is to use the global.json
as explained here https://learn.microsoft.com/en-us/visualstudio/msbuild/how-to-use-project-sdk?view=vs-2022#how-project-sdks-are-resolved
When the version is missing the resolver goes to the default installed MSBuild sdks (i.e. C:\Program Files\dotnet\sdk\8.0.104\Sdks) or to NuGet(available feeds) using the version specified inside the global.json
.
from testfx.
Thanks for the information - I'll have a look to see if adding the SDK in global.json
works.
from testfx.
Related Issues (20)
- MSTest is broken when using deployment items HOT 5
- Add code fix for MSTEST0017
- Analyzer: Ensure to use Microsoft.VisualStudio.TestTools.UnitTesting.DescriptionAttribute and not System.ComponentModel.DescriptionAttribute HOT 2
- Question: Get test file location and test line number with MSTest.Sdk/3.x.x programmatically HOT 2
- Should we do a double WaitForExit? HOT 3
- given SystemProcess wraps process, should it be disposable? HOT 1
- Unify how attributes are handled and how tests are discovered HOT 1
- Wrong year in docs/Changelog.md for 3.4.x releases HOT 1
- 3.4 is not working with Fakes HOT 12
- ConsiderEmptyDataSourceAsInconclusive throws to catch the exception on the next line
- Release notes for 3.4.0 are pointing to the main branch and some links are broken HOT 1
- AssemblyCleanup executes after first test point in multi-test-point test run via Azure Devops Release pipeline VsTest Task when all tests are associated to the same TestMethod HOT 2
- MSTest 3.4.1 does not work with .net472 AND when using deployment item when running from Visual Studio HOT 1
- should settings parsing ignore invalid values? HOT 2
- MSTest.Sdk aspire feature doesn't reference released version
- mstest 3.4.1 does not discover a method from unit tests in visual studio when returning a Task with multiple frameworks HOT 4
- Use `ConcurrentDictionary` for attribute cache
- Move ReflectionHelper to PlatformServices
- Add a globally accessible TestContext.Progress logger HOT 1
- Missing NuGet packages for 3.4.2 release HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testfx.