error CS0246: The type or namespace name "A" could not be found (are you missing a using directive or assembly reference?)

When using visual studio 2019, a reference A.dll was added to the project.

The code does not show an error and the method can be sensed normally.

But when compiling the project, prompt

: error CS0246: Could not find the type or namespace name "A" (are you missing a using directive or assembly reference?)

 

------------------------------------------------------

identify the problem:

Check project properties

Found that the project is using 4.5

Also check A.dll and found that .net frmwk 4.6.1 is used

 

Solution:

Reduce the version of A.dll to 4.5

problem solved.

 

Guess you like

Origin www.cnblogs.com/gg_lihui/p/12720608.html