Windows 8 exception “System.Security.SecurityException”

给你一囗甜甜゛ 提交于 2019-12-11 07:15:52

问题


I am starting to develop windows 8 app. I am new in windows 8 app development. I have one page i.e. MainPage.xaml. I am not able to see the design view. It gives an error.

System.Security.SecurityException

Designer could not be started because of a permissions issue on the drive to which it is installed. Please check the permissions of the folder before trying to start the designer. at Microsoft.Expression.HostUtility.Platform.AppContainerProcessDomainFactory.CreateDesignerProcess(String applicationPath, String clientPort, Uri hostUri, IDictionary environmentVariables, Int32& processId, Object& processData) at Microsoft.Expression.DesignHost.Isolation.Primitives.ProcessDomainFactory.ProcessIsolationDomain..ctor(ProcessDomainFactory factory, IIsolationBoundary boundary, AppDomainSetup appDomainInfo, FrameworkName targetFramework, String identifier, String baseDirectory) at Microsoft.Expression.DesignHost.Isolation.Primitives.ProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary) at Microsoft.Expression.HostUtility.Platform.AppContainerProcessDomainFactory.CreateIsolationDomain(IIsolationBoundary boundary) at Microsoft.Expression.DesignHost.Isolation.Primitives.IsolationBoundary.Initialize() at Microsoft.Expression.DesignHost.Isolation.Primitives.IsolationBoundary.CreateInstance[T](Type type) at Microsoft.Expression.DesignHost.Isolation.IsolatedExportProvider.Initialize() at Microsoft.VisualStudio.ExpressionHost.Services.VSIsolationService.CreateExportProvider(IIsolationTarget isolationTarget, ICatalogFactory catalogFactory, IExportFilter filter) at Microsoft.Expression.DesignHost.Isolation.IsolationService.CreateLease(IIsolationTarget isolationTarget) at Microsoft.Expression.DesignHost.IsolatedDesignerService.CreateLease(IIsolationTarget isolationTarget, CancellationToken cancelToken, DesignerServiceEntry& entry) at Microsoft.Expression.DesignHost.IsolatedDesignerService.IsolatedDesignerView.CreateDesignerViewInfo(CancellationToken cancelToken) at Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler.InvokeWithCulture[T](CultureInfo culture, Func2 func, CancellationToken cancelToken) at Microsoft.Expression.DesignHost.Isolation.IsolatedTaskScheduler.<>c__DisplayClassa1.b__6() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute()

I have given administrative rights to the folders. But I am not getting why this error is getting?

Can someone please help me to solve this ?


回答1:


I have just upgraded from Windows 7 to Windows 10

And the first problem i had with Windows 10 is this(besides the one where you need to enable "Developer mode" this is probably only in windows 10), and the trick for me that made this work was running Visual Studio 2013 as Admin

Hope this helps




回答2:


I upgraded from Win 7 to Win 8.1 and faced with the same issue.

I solved it like this:

  1. open the installation folder of Visual Studio with the explorer
  2. go to Common7 => IDE
  3. look for "VSWinExpress"-File
  4. right-click "execute as admin"

that's it!




回答3:


I encountered the identical problem recently while developing a Windows Phone 8.1 ARM application, and was stumped until I amalgamated several posts from the Web.

(1) I ran "devenv.exe /resetsettings". This removed the "System.Security.SecurityException" error, but left me with the message "Design view is unavailable for x64 and ARM target platforms".

(2) At this point it seems the Visual Studio Designer does not work when the Solution Platform (the drop-down combo box in the middle of the tool bar) is set to "ARM". The workaround is to temporarily set the Solution Platform to "WIN32", do what you need to, set the Solution Platform back to "ARM", and compile.

Although a slight pain, it now works for me.




回答4:


Just run Visual Studio as Administrator. When it asks for permission to run the designer click ok and wait.




回答5:


I will just try to help with some steps and links as it is not reproduce able on my sid e:)

Steps:

THIS MUST BE DONE AS ADMINISTRATOR

  • Select the folder in Windows Explorer, right-click and select 'Properties'
  • Click the 'Security' tab then click the 'Advanced...' button
  • At the top of the new window there should 'Name' and 'Owner'. Next to owner click the 'Change' link.
  • In the new window make sure you have your local computer selected under 'From this location:'. If not click 'Locations...' and select your local computer then click 'OK'.
  • In the textbox under 'Enter the object name to select, type 'Users' and click 'Check Names...'
  • Click 'OK'
  • At the top of the page check the option 'Replace owner on subcontainers and objects'. Click 'Apply'. You may be prompted to shut the properties dialog to apply the ownership changes, if so close all dialogs then repeat steps 1 and 2.
  • On the 'Permissions' tab select 'Users' and click 'Edit'.
  • Select 'Full Control' then click 'OK'.
  • When you start VS2012 after this and open a designer it will prompt you that it needs to change permissions, do this and this time it will succeed!

Now support links if the steps don't work

Xaml designer issue

this is not only in windows 8 it happened with me in windows 7 when I was in silverlight but I managed to fix some how .. But now in metro apps I still don't get this error :) Please try and let me know



来源:https://stackoverflow.com/questions/18809503/windows-8-exception-system-security-securityexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!