Namespace not recognized (even though it is there)

前端 未结 20 1940
终归单人心
终归单人心 2020-11-28 21:27

I am getting this error:

The type or namespace name \'AutoMapper\' could not be found (are you missing a using directive or an assembly reference?)

20条回答
  •  余生分开走
    2020-11-28 21:58

    This happened to me in Visual Studio 2019. For me, I was trying to reference another project in my solution. Here are the steps I took in case it helps anyone else:

    1. Ensured the project I wanted to reference was listed under References
    2. Ensured both projects were using the correct version of .NET Framework
    3. Built the project (clicked green "Start" arrow)

    I was confused because I was still getting the error after steps 1 and 2, but building the project seemed to resolve it.

提交回复
热议问题