c# - The name "XYZ" does not exist in the namespace "clr-namespace:ABC" -
i working on creating markup extensions , started weird vs behaviours. have extracted , pinpointed issue in separate solution. problem vs can't create clr object in xaml.
here is:
view:
<window x:class="wpfapplication4.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wpfapplication4="clr-namespace:wpfapplication4"> <window.resources> <wpfapplication4:dog x:key="doggy" /> </window.resources> <grid /> </window>
code behind:
using system.windows; namespace wpfapplication4 { public partial class mainwindow : window { public mainwindow() { initializecomponent(); } } }
dog class:
namespace wpfapplication4 { public class dog { } }
app.xaml (no code in app.xaml.cs):
<application x:class="wpfapplication4.app" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" startupuri="mainwindow.xaml"> <application.resources> </application.resources> </application>
exception getting:
error 1 name "dog" not exist in namespace "clr-namespace:wpfapplication4". \\hopr1\folders$\vxk\documents\visual studio 2012\projects\wpfapplication4\mainwindow.xaml 6 9 wpfapplication4
i able run solution, designer fails "invalid markup" error ideas?
edit
i running vs 2012 update 2 same solution work in vs 2012 update 1
your solution running on network share. .net (and visual studio) applications can run permission / access issues when running on network share.
copy solution local drive (with full trust) , should fine.
it possible network drive working full trust - can find answers on stackoverflow , other places - in experience keep running obstacles when this, try avoid unless it's absolutely critical problem @ hand.
e.g. question gives instructions how this:
give fulltrust unc share visual studio 2012 , .net 4.0
i've ever tried vs2010 (as indicated in link) might have better joy 2012.