开发者

Why does Visual Studio 2010 ignore my reference as soon as I build?

开发者 https://www.devze.com 2023-01-31 06:06 出处:网络
I have a command line app that uses a certain assembly.The assembly is sitting in the root of the project, and set to \"Copy Always.\"

I have a command line app that uses a certain assembly. The assembly is sitting in the root of the project, and set to "Copy Always."

I add a reference to that assembly, and Visual Studio 2010 is happy -- Intellisense highlights everything correctly, and no errors are reported.

But as soon as I actually build, I get compilation errors like I haven't added the reference, and Intellisense suddenly gives me 开发者_JAVA技巧red squigglies as if the reference was never added.

But the reference is still there.

If I delete the reference and then re-add it, Visual Studio gets happy again, and the red squigglies go away. Then I build, and the same thing happens again.

So, Visual Studio agrees that the reference is there. Until I build. Then it claims its not. Even though it is.

And this only happens with a specific DLL (NLog, if it matters). Another DLL (HtmlAgilityPack) works fine, and it's set up and configured the exact same way.


With a little search I found a problem with the .NET client profile. Try looking at that link and see if it resolves the issue.

There's also some posts on it at the microsoft connect website if you're interested in further reading.

0

精彩评论

暂无评论...
验证码 换一张
取 消