gpt4 book ai didi

c# - Xamarin 中的 ASP.NET MVC 3 项目出现 System.UnauthorizedAccessException 错误

转载 作者:太空狗 更新时间:2023-10-30 00:41:28 24 4
gpt4 key购买 nike

我在 Mac OS X (10.9) 上运行 Xamarin (4.0.10 build 5)。我创建了 ASP.NET MVC 3 项目。第一次运行时出现 Microsoft.AspNet.WebPages 错误。我在 this 之后解决了这个问题文章并修复它。现在当我运行它时会出现另一个错误:

System.UnauthorizedAccessException Access to the path "/Library/Frameworks/Mono.framework/Versions/3.2.0/etc/mono/registry" is denied.

Stack trace:

at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00064] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.0/mcs/class/corlib/System.IO/Directory.cs:113 at System.IO.Directory.CreateDirectory (System.String path) [0x000a4] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.0/mcs/class/corlib/System.IO/Directory.cs:80 at System.IO.DirectoryInfo.Create () [0x00000] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.0/mcs/class/corlib/System.IO/DirectoryInfo.cs:141 at (wrapper remoting-invoke-with-check) System.IO.DirectoryInfo:Create () at System.IO.Directory.CreateDirectoriesInternal (System.String path) [0x00039] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.0/mcs/class/corlib/System.IO/Directory.cs:98 at System.IO.Directory.CreateDirectory (System.String path) [0x000a4] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.0/mcs/class/corlib/System.IO/Directory.cs:80 at Microsoft.Win32.KeyHandler..ctor (Microsoft.Win32.RegistryKey rkey, System.String basedir, Boolean is_volatile) [0x0004a] in /private/tmp/source/bockbuild-xamarin/profiles/mono-mac-xamarin-no-pcl/build-root/mono-3.2.0/mcs/class/corlib/Microsoft.Win32/UnixRegistryApi.cs:136

请帮我解决这个问题。

最佳答案

在运行 Arch 发行版的 Linux 机器上,我进行了以下更改以解决安全问题:

sudo mkdir /etc/mono/registry
sudo mkdir /etc/mono/registry/LocalMachine
sudo chmod g+rwx /etc/mono/registry/
sudo chmod g+rwx /etc/mono/registry/LocalMachine

关于c# - Xamarin 中的 ASP.NET MVC 3 项目出现 System.UnauthorizedAccessException 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20512784/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com