xunit.net - Why doesn't .NET Core and xUnit recognise my imported namespaces? -
i have project compiles want test using xunit. although project lets me add references , builds, add using
statement test class red squiggly lines , error "type or namespace not found."
even though xproj of project want test has been added references, , namespaces exist. has have done, can't see what. using earlier versions of .net, have added references test projects hundreds of times without issue.
so different in way .net works, , why not recognize namespaces in referenced assemblies?
update: have removed xunit , got mstest working, have same issue. may feature of way have dotnetcore set up, , references in json files more else.
this structure works me in .net core 1.0:
global.json
{ "projects": [ "src", "test" ], "sdk": { "version": "1.0.0-preview2-003121" } }
src/mylibrary/project.json
{ "dependencies": { }, "frameworks": { "netstandard1.3": { "dependencies": { "netstandard.library": "1.6.0" } } }, "version": "1.0.0" }
test/mylibrary.test/project.json
{ "dependencies": { "dotnet-test-xunit": "2.2.0-preview2-build1029", "microsoft.netcore.app": { "type": "platform", "version": "1.0.0" }, "mylibrary": { "target": "project", "version": "1.0.0" }, "xunit": "2.1.0" }, "frameworks": { "netcoreapp1.0": { "imports": [ "dnxcore50", "portable-net45+win8" ] } }, "testrunner": "xunit", "version": "1.0.0" }
using directory , project structure, both visual studio test explorer , dotnet test
work , can run xunit tests.
Comments
Post a Comment