Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Access to the path 'C:\Users\...\Documents\My Music' is denied

Tags:

wpf

I had this strange error coming up: Access to the path 'C:\Users...\Documents\My Music' is denied. Which happens in the XAML designer.

Honestly I find this completely unprofessional because I am sure I'm not the only one getting this, and this is the 2nd time this issue has cropped up since I've started using XAML.

First time it happened I moved my project out of myDocuments to the C:\ drive. That cleared it up.

But now it has come back.

How can I get rid of this issue permanently, and why is it happening?

For clarification I'm not trying to load a resource from this directory. the XAML designer seems to take it upon itself to traverse myMusic.

Why would it do this?

Stack trace:

Access to the path 'C:\Users\...\Documents\My Music' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.AddSearchableDirsToStack(SearchData localSearchData)
   at System.IO.FileSystemEnumerableIterator`1.MoveNext()
   at Microsoft.Expression.Utility.IO.PathHelper.<ResolveWildcard>d__0.MoveNext()
   at Microsoft.Expression.HostUtility.ShadowCopy.HostShadowCopyProvider.CacheFiles(String sourceDirectory, String targetDirectory, IEnumerable`1 paths, Boolean watchFiles)
   at Microsoft.Expression.HostUtility.ShadowCopy.HostShadowCopyProvider.CacheFiles(String sourceDirectory, String targetDirectory, IEnumerable`1 paths, Boolean watchFiles)
   at Microsoft.Expression.HostUtility.ShadowCopy.HostShadowCopyProvider.ShadowCopyFiles(String[] sourcePaths, String sourceRoot, String destinationRoot, Boolean watchFiles)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteHostShadowCopyProvider.<>c__DisplayClass1.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostShadowCopyProvider.ShadowCopyFiles>b__0()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.UnauthorizedAccessException
Access to the path 'C:\Users\Michael\Documents\My Music' is denied.

Server stack trace: 
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteHostShadowCopyProvider.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostShadowCopyProvider.ShadowCopyFiles(String[] sourcePaths, String sourceRoot, String destinationRoot, Boolean watchFiles)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteHostShadowCopyProvider.ShadowCopyFiles(String[] sourcePaths, String sourceRoot, String destinationRoot, Boolean watchFiles)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostShadowCopyProvider.<>c__DisplayClass2.<Microsoft.Expression.DesignHost.IHostShadowCopyProvider.ShadowCopyFiles>b__0(IRemoteHostShadowCopyProvider s)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<MarshalOut>b__3()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.UnauthorizedAccessException
Access to the path 'C:\Users\Michael\Documents\My Music' is denied.
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CallSynchronizationMode syncMode, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CallSynchronizationMode syncMode)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func, CallSynchronizationMode syncMode)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalHostShadowCopyProvider.Microsoft.Expression.DesignHost.IHostShadowCopyProvider.ShadowCopyFiles(String[] sourcePaths, String sourceRoot, String destinationRoot, Boolean watchFiles)
   at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.CreateClassicShadowCopy(String assemblyPath, String projectPath)
   at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveShadowCopyAssembly(String assemblyPath, String projectPath)
   at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveAssembly(String assemblyPath, String assemblyFullName, String projectPath)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(String path, String assemblyFullName)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(HostReferenceData reference)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.UpdateAssemblyReferences(IEnumerable`1 referencesToUpdate)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver..ctor(IHostProject project, DesignerContext designerContext)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyService.<.ctor>b__0(IHostProject project)
   at Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection`2.CreateItems(TKey key)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Expression.Utility.Collections.SuspendableKeyedCollection`2.GetItem(TKey key)
   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyService.GetProjectAssemblyResolver(IHostProject project)
   at Microsoft.Expression.DesignSurface.Project.ProjectContextBase.Initialize()
   at Microsoft.Expression.DesignSurface.Project.XamlProjectContext.Initialize()
   at Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetProjectContext(IHostProject project, IPlatform platform, Boolean create)
   at Microsoft.Expression.DesignSurface.Project.ProjectContextManager.GetSourceItemContext(IHostSourceItem sourceItem)
   at Microsoft.Expression.DesignSurface.DesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__f(CancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.CallWithCancellation[TResult](IRemoteCancellationToken remoteToken, Func`2 func)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.<>c__DisplayClass10.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__e()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass16`1.<MarshalIn>b__15()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.UnauthorizedAccessException
Access to the path 'C:\Users\...\Documents\My Music' is denied.

Server stack trace: 
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalIn(Action action, Int32 targetApartmentId)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn(IRemoteObject targetObject, Action action)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalIn[TResult](IRemoteObject targetObject, Func`1 func)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.RemoteDesignerService.Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken remoteToken)
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]: 
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner(IRemoteHostSourceItem remoteItem, IRemoteHostTextEditor remoteEditor, IRemoteCancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass8.<CreateDesignerImpl>b__6(IRemoteDesignerService d)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass4`2.<MarshalOut>b__3()
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

System.UnauthorizedAccessException
Access to the path 'C:\Users\Michael\Documents\My Music' is denied.
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOutSynchronous(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, CallSynchronizationMode syncMode, WaitHandle timeoutSignal)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action, CallSynchronizationMode syncMode)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func, CallSynchronizationMode syncMode)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.<>c__DisplayClass12.<Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner>b__11(RemoteCancellationToken remoteToken)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CallWithCancellation[TResult](CancellationToken cancelToken, Func`2 func)
   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.Microsoft.Expression.DesignHost.IDesignerService.CreateDesigner(IHostSourceItem item, IHostTextEditor editor, CancellationToken cancelToken)
   at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken)
like image 437
JL. Avatar asked Oct 04 '22 07:10

JL.


1 Answers

Found the solution : http://readmystuff.wordpress.com/2013/08/08/wpf-access-to-the-path-cusersmichaeldocumentsmy-music-is-denied/

Oh thanks for the downvotes!

like image 191
JL. Avatar answered Oct 29 '22 16:10

JL.