我遇到了这个奇怪的错误: 访问路径“C:\ Users ... \ Documents \ My Music”被拒绝。这发生在XAML设计器中。
老实说,我发现这完全不专业,因为我确信我不是唯一一个得到这个,这是自我开始使用XAML以来第二次出现这个问题。
第一次发生这种情况时,我将我的项目从myDocuments移到了C:\驱动器。这清除了它。
但现在已经回来了。
如何永久摆脱这个问题,为什么会这样?
为了澄清我没有尝试从此目录加载资源。 XAML设计师似乎可以自己来遍历myMusic。
为什么会这样做?
堆栈追踪:
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)
答案 0 :(得分:5)