更新时间:2023-11-19 19:19:40
终于找到了罪魁祸首!!
在我的工作中,我们的桌面托管在网络共享上。我带了两个我在家工作的应用程序,暂时将应用程序文件放在桌面上进行一些快速的小改动。事实证明,WPF Designer中存在一个错误,如果从共享运行应用程序,应用程序将无法解析程序集引用。一旦我把它移到我当地的D盘,一切都运转良好。
在这里找到答案 - >
http: //social.msdn.microsoft.com/Forums/vstudio/en-US/75c4cc8d-9a81-4bda-84f0-f619f7493b3b/vs2010-xaml-namespace-intellisense-not-working?forum=vswpfdesigner
请参阅我对您的解决方案1的评论。这根本不是解决方案。实际上,引用同一项目中定义的类型根本不是问题。这不容易,很容易。
首先,通过输入xmlns:开始将xmlns
属性添加到***XAML元素。 intellisense将显示您可以引用的本地命名空间的变体。选择合适的一个;你会完成的。很抱歉,如果Intellisense没有处理某些设置。我从来没有遇到过这个错误,可以向你保证它一般都在工作。你可以做什么?找出一个有效的命名空间值语法并学习它,手动输入。-SA
>
I know this question has been asked multiple times, and I've gone through them all. Hopefully I didn't just miss something in the previous answers, but I'm stumped.
My application was working fine yesterday, but today I booted it up and now none of my file references, including ViewModels or DependencyProperties which I have defined in external files, can be found. I'm coding in VB (as you'll see), I've tried changing / adding Namespaces and nothing!
If someone has some insight into this issue I'm all ears!
Solution Structure
Image Of Solution
XAML Code
<Window
xmlns:l="clr-namespace:PrairieWestIceCreamWPF"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="WeeklyOutlookView" Title="WeeklyOutlookView" Name="WeeklyOutlookView" Height="463.5" Width="1280" l:WindowBehavior.WindowClosing="{Binding WindowClosingCommand}">
<Window.DataContext>
<l:WeeklyOutlookViewModel />
</Window.DataContext>
Errors
The Name "WindowBehavior" does not exist in the namespace "clr-namespace:PrairieWestIceCreamWPF"
The Name "WeeklyOutlookViewModel" does not exist in the namespace "clr-namespace:PrairieWestIceCreamWPF"
Finally found the culprit!!
At my work, our desktops are hosted on a network share. I had brought two applications I was working on from home and dropped the application files temporarily on the desktop to make some quick minor changes. Turns out there is a bug in the WPF Designer where the application will not be able to resolve assembly references if the application is being run from a share. As soon as I moved it to my local D drive, everything work perfectly.
Found answer here ->
http://social.msdn.microsoft.com/Forums/vstudio/en-US/75c4cc8d-9a81-4bda-84f0-f619f7493b3b/vs2010-xaml-namespace-intellisense-not-working?forum=vswpfdesigner
Please see my comment to your "Solution 1". This is not a solution at all. Actually, referencing the types defined in the same project is not a problem at all. It is not easy, it is very easy.
To start, start adding thexmlns
attribute to your top XAML element by typing "xmlns:". The intellisense will show you the variants of local namespaces you can reference. Choose an appropriate one; and you will be done. Sorry if Intellisense is not working on some settings. I never faced this bug and can assure you that it is generally working. What you can do? Find out a single case of valid syntax for namespace value and learn it, enter manually.—SA