Skip to content

The type or namespace name 'X' could not be found in unit tests #73509

Answered by huoyaoyuan
ajsaclayan asked this question in Q&A
Discussion options

You must be logged in to vote

I've explicitly added the reference to the test project:

This does not work. The reference belongs to the process that executes the test ("host"), not the code that's being compiled ("target"). When working with compilers, it's especially important to distinguish host and target. Don't use things from host process for compilation.

You can search for examples of ReferenceAssemblies = ReferenceAssemblies.Net.Net60 or similar in roslyn repo.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ajsaclayan
Comment options

Answer selected by ajsaclayan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants