Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC 3 project in Xamarin gives System.UnauthorizedAccessException error

I run Xamarin (4.0.10 build 5) on Mac OS X (10.9). I created ASP.NET MVC 3 project. First run gave error with Microsoft.AspNet.WebPages. I solved this issue following this article and fixed it. Now when I run it gives another error:

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

Please help me to solve this issue.

like image 431
KenanBek Avatar asked Mar 21 '23 08:03

KenanBek


2 Answers

On a Linux machine running Arch distribution I made the following changes to make the security issue work:

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
like image 121
Kedde Avatar answered Apr 06 '23 08:04

Kedde


See if this blog post helps you.

(a crack at a solution)

sudo mkdir /Library/Frameworks/Mono.framework/Versions/Current/etc/mono/registry
sudo chmod g+rwx /Library/Frameworks/Mono.framework/Versions/Current/etc/mono/registry
like image 26
Erik Kerber Avatar answered Apr 06 '23 08:04

Erik Kerber