我有一個包含多個項目的VS2008(C#)的解決方案。我剛剛爲我們的構建過程重新構建了一些.csproj文件,並且突然在編碼項目B時無法識別類代碼中的項目A的引用......認爲我創建的變量類型下的紅色波浪線。但是,構建解決方案不會產生錯誤。爲什麼它表現得像這樣?Visual Studio:代碼中的引用無法識別?
11
A
回答
19
我建議你清理你的Visual Studio臨時文件 - 它經常會對項目結構感到困惑,並且需要重新開始。
首先,完全退出VS並重新啓動它。如果問題仍然存在,找到您的VS緩存文件夾並將其刪除,然後重建。
如需查找您的緩存文件夾,請致電check this post。
2
在B的項目屬性中,確保項目A在依賴項下被選中。
1
確保這兩個項目正在建設中的配置管理器
(右鍵單擊解決方案,然後單擊「配置管理器」)
您也可以懸停在紅線或只是再次打造看看如果你有更多的細節。 C#和VB都很擅長告訴你他們爲什麼不開心。
3
當VS開始行爲奇怪的時候,我無法找到一個邏輯修復,我殺了Visual Studio,並通過刪除所有bin/obj文件夾來手動執行'clean'。
我有一個批處理文件,這比我手動執行此操作更快。我把它放在我的解決方案目錄中,我的所有項目都在子目錄中。
rem "%%~dpa" says: Give me the (d)drive and (p)path of the (a, %%a) file.
rem However, our dir /a:d will result in only listing folders...
rem The final "%%a" is just appending the 'file' (diretory name) to the
rem drive-and-path string
for /f %%a in ('dir /b /a:d *.*') do call :process "%%~dpa%%a"
pause
goto :eof
:process
echo Looking in %1
cd "%1"
if EXIST "%1\bin" (
echo Found 'bin' - it's gone now.
rd /s /q "%1\bin"
)
if EXIST "%1\obj" (
echo Found 'obj' - it's gone now.
rd /s /q "%1\obj"
)
cd ..
相關問題
- 1. Visual Studio 2017無法識別代碼中的錯誤
- 2. Visual Studio代碼無法識別來自`node_modules`的TypeScript模塊
- 3. CLR在Visual Studio 2015 C++中的應用(無法識別的代碼?)
- 4. ViewModel不被Visual Studio代碼中的MVC 6識別代碼
- 5. Visual Studio無法識別DNN的DnnFilePicker
- 6. 爲什麼Visual Studio無法識別System.Web.SessionState?
- 7. 無法在Visual Studio代碼
- 8. Java - createImageIcon()在代碼中無法識別?
- 9. Visual Studio代碼Powershell擴展無法在調試時識別配置文件
- 10. Visual Studio在IDE中無法識別本地引用,生成工作正常
- 11. 在Visual Studio中引用DLL代碼
- 12. 無法引用dll程序集到Visual Studio代碼項目
- 13. Visual Studio 2012無法識別.js文件中的Javascript
- 14. visual studio無法識別版本10.0.14393.0中的windows 10 sdk
- 15. Android Studio無法識別SDK
- 16. Android Studio無法識別setOnClickListener
- 17. Android Studio無法識別運行時權限代碼
- 18. Android Studio中無法識別的Facebook SDK
- 19. oracle weblogic 10.3無法識別代碼
- 20. XAML無法識別類代碼隱藏
- 21. Eclipse無法識別Scala代碼
- 22. 無法在Visual Studio 2008中的代碼隱藏中引用ASP.NET控件
- 23. Visual Studio代碼pylint:無法導入'protorpc'
- 24. 無法更改Visual Studio代碼設置
- 25. 無法安裝Visual Studio代碼擴展
- 26. Visual Studio無法看到代碼
- 27. Visual Studio代碼無法正確配置
- 28. Visual Studio代碼:無法找到preLaunchTask'build'?
- 29. Visual Studio代碼無法調試Electron
- 30. 無法在Visual Studio代碼中調試C++代碼
他們被檢查。 – Chris 2009-06-24 15:34:38
哦,好的。這值得一試。 – rlbond 2009-06-24 15:35:46
是的,至少+1拍攝:)謝謝。 – Chris 2009-06-24 15:36:59