locked
VS 2012 RC XAML Designer Crashes with Access Denied

    Question

  • This appears to be very similar problem to Preview and Beta builds of VS 2012.  The work around that was blogged did not help. The installation of Windows 8 RP was an upgrade of Windows 7.  VS2012 RC has been installed and uninstalled (that took some extra effort) and reinstalled to unsuccessfully get around an issues with the JavaScript debugger for Metro Apps.

    System.UnauthorizedAccessException

    Error 5: Access is denied : 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\Microsoft.CSharp.dll'


       at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.WaitForCompletion(NestedCallContext nestedCallContext, BlockingCall call, WaitHandle timeoutSignal)   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.MarshalOut(Action action, Int32 targetApartmentId, WaitHandle aborted, WaitHandle timeoutSignal)   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TValue](RemoteHandle`1 targetObject, Action action)   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.MarshalOut[TResult,TValue](RemoteHandle`1 targetObject, Func`2 func)   at Microsoft.Expression.DesignHost.Isolation.Remoting.LocalDesignerService.CreateDesignerImpl(IHostSourceItem item, IHostTextEditor editor, RemoteCancellationToken remoteCancelToken)   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)


    System.UnauthorizedAccessException

    Error 5: Access is denied : 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\Microsoft.CSharp.dll'


    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__DisplayClass2.<CreateDesignerImpl>b__0(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

    Error 5: Access is denied : 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\Microsoft.CSharp.dll'


       at Microsoft.Expression.Utility.Interop.NativeMethods.GetFileAttributesInternal(String path)   at Microsoft.Expression.Utility.Interop.NativeMethods.GetFileAttributes(String path, FileAttributes& attributes)   at Microsoft.Expression.Utility.AssemblyHelper.GetAssemblyNameFromPath(String path)   at Microsoft.Expression.Utility.WindowsRuntimeContext.LoadRuntimeAssemblyFrom(String path)   at Microsoft.Expression.Utility.WindowsRuntimeContext.LoadFrom(String path)   at Microsoft.Expression.Utility.AssemblyHelper.Load(AssemblyName assemblyName)   at Microsoft.Expression.DesignSurface.Assemblies.WindowsXamlAssemblyResolver.ResolveRuntimeAssembly(AssemblyName assemblyName)   at Microsoft.Expression.Platform.PlatformService.ResolvePlatformAssembly(AssemblyName assemblyName)   at Microsoft.Expression.DesignSurface.DesignerContext.PlatformAssemblyResolver.ResolveAssembly(AssemblyName assemblyName)   at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveAssembly(AssemblyName assemblyName, IEnumerable`1 assemblyResolverTable)   at Microsoft.Expression.DesignSurface.Assemblies.AssemblyService.ResolveAssembly(IHostProject project, String path)   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(String path)   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.GetAssemblyInformation(IHostReferenceItem 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__DisplayClass9.<Microsoft.Expression.DesignHost.Isolation.Remoting.IRemoteDesignerService.CreateDesigner>b__8()   at Microsoft.Expression.DesignHost.Isolation.Remoting.ThreadMarshaler.<>c__DisplayClass19`1.<MarshalIn>b__18()   at Microsoft.Expression.DesignHost.Isolation.Remoting.STAMarshaler.Call.InvokeWorker()

    Friday, June 15, 2012 2:11 PM

All replies

  • Hi Keith,

    Unfortunate that you are still running into this, can you please follow these steps and see if this helps:

    1. Right click %Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5 or respective location on your machine.

    2. You will get something like this (it is important to know if you can find the ALL APPLICATION PACKAGES ACL on these folders, as in the screenshot below).

     

      3. If "ALL APPLICATION PACKAGES" is NOT available, please use this work-around:

    1.   Shut down all running instances of Visual Studio.

    2. Launch a command prompt as an Administrator.

    3. Type the following in sequence:

          a.  pushd %VS110COMNTOOLS%

          b. icacls “C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5” /grant *S-1-15-2-1:(OI)(F)

          c. icacls “C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5” /grant *S-1-15-2-1:(CI)(F)

    This should fix the problem, if you have more questions, please send me an email at navits at microsoft dot com.



    Friday, June 15, 2012 3:43 PM
  • Cool that fixed the XAML designer issue.  Now looks like the only outstanding issue is getting JavaScript debugging to work.
    Friday, June 15, 2012 4:41 PM
  • This worked for me too, thank so much for the help.

    I had to use a relative path instead of absolute for the file parameter. And line 3.b. is missing a space before grant.

    Monday, June 18, 2012 3:22 PM
  • Yep, worked for me, too. For those who, like me, didn't know right off how to run the command prompt as administrator:

    Press Windows key + E

    Enter shell:system in the edit box at the top of Explorer

    Press <Enter>

    Navigate to cmd.exe, right-click it, and select "Run as Administrator"

    Thursday, July 26, 2012 4:54 AM
  • @Navits, you are a life saver. I was literally going bald trying to figure out what is going wrong. If you dont mind, can you please tell me why that was happening.

    THANK YOU.

    Thursday, August 9, 2012 6:56 AM
  • Hi Keith,

    Unfortunate that you are still running into this, can you please follow these steps and see if this helps:

    1. Right click %Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5 or respective location on your machine.

    2. You will get something like this (it is important to know if you can find the ALL APPLICATION PACKAGES ACL on these folders, as in the screenshot below).

     

      3. If "ALL APPLICATION PACKAGES" is NOT available, please use this work-around:

    1.   Shut down all running instances of Visual Studio.

    2. Launch a command prompt as an Administrator.

    3. Type the following in sequence:

          a.  pushd %VS110COMNTOOLS%

          b. icacls “C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5” /grant *S-1-15-2-1:(OI)(F)

          c. icacls “C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5” /grant *S-1-15-2-1:(CI)(F)

    This should fix the problem, if you have more questions, please send me an email at navits at microsoft dot com.



    You've sort of got the file param incorrect, Use the relative Path instead like Dano63 Said.

    pushd %VS110COMNTOOLS%

    icacls "%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5" /grant *S-1-15-2-1:(OI)(F)

    icacls "%ProgramFiles(x86)%\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5" /grant *S-1-15-2-1:(CI)(F)

    Wednesday, August 22, 2012 12:15 AM
  • This solution only works for me as Administrator but not as me. Any idea?
    Monday, October 15, 2012 6:20 AM
  • I already had "ALL APLICATION PACKAGES" option there but it was still giving me the same problem. i did what you said also, and it still did not resolve my issue. it says "Designer requires certain permissions to be set on the folder which is installed" then it prompt me to click OK to bring a cmd that can give it full permission, but the cmd pops up blanks and just stays there... help
    Monday, October 22, 2012 2:17 PM
  • It would be great if you can clarify which versions of VS and Windows you are using.

    Thanks!
    Unni


    Unni Ravindranathan, Program Manager, Microsoft Expression This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, October 24, 2012 1:04 AM
  • What do we do if ALL APPLICATION PACKAGES is available but we're still having an issue? I've tried doing a repair, no luck.

    I'm using VS2012 Pro from MSDN.
    • Edited by Andrew Le Nguyen Friday, November 2, 2012 3:55 AM Stating version of VS
    Friday, November 2, 2012 3:50 AM
  • I'm using VS2012 Pro from MSDN and have the issue where I already had ALL APP PACKAGES listed. Please help.
    Friday, November 2, 2012 3:56 AM
  • Hi Navits,

    I have the same case with the Blend for Visual Studio 2012, I get the error trying to open a page in the design mode:

    System.UnauthorizedAccessException
    Access to the path 'C:\Program Files (x86)\DevExpress\DXTREME 12.2\System\WinRT\SDK\DevExpress.Core\12.2\References\CommonConfiguration\neutral' 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)


    System.UnauthorizedAccessException


    Access to the path 'C:\Program Files (x86)\DevExpress\DXTREME 12.2\System\WinRT\SDK\DevExpress.Core\12.2\References\CommonConfiguration\neutral' 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:\Program Files (x86)\DevExpress\DXTREME 12.2\System\WinRT\SDK\DevExpress.Core\12.2\References\CommonConfiguration\neutral' is denied.

       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)   at System.IO.FileSystemEnumerableIterator`1.CommonInit()   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)   at System.IO.Directory.EnumerateFiles(String path, String searchPattern, SearchOption searchOption)   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.<FindMetadataAssembly>b__14(DirectoryFileNameSpecification specification)   at System.Linq.Enumerable.<SelectManyIterator>d__31`3.MoveNext()   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.FindBestMetadataAssembly(IEnumerable`1 possiblePaths)   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.FindMetadataAssembly(String assemblyPath, String designerExtension)   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.EnsureDesignMetadataLoaded(Boolean showErrors)   at Microsoft.Expression.DesignSurface.Assemblies.ProjectAssemblyResolver.RegisterDesignMetadata()   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()

    I tried to solve the case following you approach with no result.

    From VS2012 I am able to open the page in the design mode but from Blend I can not and I am getting the above error.

    Please advise and I kindly request to post an update in case you hear from Microsoft if is intended to proceed with a fix.

    Thank you.

    Tuesday, December 11, 2012 9:50 PM
  • Hi Chatzisa,

    This is a different issue and has been fixed on our end. If you can get in touch with me at navits at microsoft dot com, I can share the fix with you. Also, as a work-around you can try adding "ALL APPLICATION PACKAGES" ACL to  the "DevExpress" folder under "C:\Program Files (x86)" and then try starting VS.

    Thanks,

    Navit Saxena

    Thursday, December 13, 2012 12:54 AM
  • Hi Navit,

    I appreciate your response. I will try asap with the work-around and in case does not work I will contact you via email in order to get and try with the fix.

    Thank you.

    Thursday, December 13, 2012 2:15 PM
  • Hi Navit,

    I tried adding "ALL APPLICATION PACKAGES" ACL to  the "DevExpress" folder under "C:\Program Files (x86)" with full permissions and works fine, both VS2012 and Blend loading the pages in the designer fine !!!

    This is an acceptable solution for me, thank you !!!

    • Proposed as answer by Chatzisa Thursday, December 13, 2012 8:00 PM
    Thursday, December 13, 2012 8:00 PM
  • thank you!

    • Proposed as answer by Sebastian_R Wednesday, May 1, 2013 9:13 AM
    • Unproposed as answer by Sebastian_R Wednesday, May 1, 2013 9:13 AM
    Monday, December 31, 2012 4:08 PM
  • Hey i have the same problem all steps here has worked but i doesnt find by the DevExpress folder. Iwanna to try it but  he cant find it, please help.

    Sebastian_R
    Wednesday, May 1, 2013 9:13 AM
  • You should not longer have to apply this workaround. We have fixed all known issues here with Visual Studio 2012 Update 2.

    Thanks,
    Unni


    Unni Ravindranathan, Program Manager, Visual Studio and Blend This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, May 3, 2013 4:32 AM
  • You should not longer have to apply this workaround. We have fixed all known issues here with Visual Studio 2012 Update 2.

    Thanks,
    Unni


    Unni Ravindranathan, Program Manager, Visual Studio and Blend This posting is provided "AS IS" with no warranties, and confers no rights.

    I think not i have make a clean install of my system and it comes again.

    I have make a new project i have run it 1 time and then the design bring me the unauthorized Exception.

    Friday, May 3, 2013 4:57 AM
  • Hi Navit, 

    And if i haven't got this "DevExpress" folder there? 

    Thanks.

    Friday, December 19, 2014 10:49 PM
  • Please upgrade to a current version of Visual Studio. If you are still having trouble then please open a new thread with a clear description of your problem. The issues in this thread have been fixed and the workarounds in this thread are no longer relevant, but you may be running into something else.
    Friday, December 19, 2014 10:53 PM
    Owner