Is an error you are likely to see if you run a Visual Studio MVC template in Mono. There are two options for fixing it.
- Do this from the command line:
sudo mkdir /Library/Frameworks/Mono.framework/Versions/3.2.5/etc/mono/registry sudo chmod g+rwx /Library/Frameworks/Mono.framework/Versions/3.2.5/etc/mono/registry
3.2.5with your mono version, which you get at the command line with
- Or delete the reference to
Microsoft.Web.Infrastructure.dllfrom the project and delete it from the bin directory too.
The important difference is that deleting
Microsoft.Web.Infrastructure.dll will stop your project working on .Net, so the registry access is simpler for cross-platformers. Another option for cross-platform project files would be something like this in the .csproj file:
<Target Name="AfterBuild"> <Delete Files="$(WebProjectOutputDir)\bin\Microsoft.Web.Infrastructure.dll" Condition=" '$(OS)' != 'Windows_NT'" /> </Target>
I prefer the 'grant access to the registry approach' myself but it does mean having to re-run the 2 line script for every new version of mono.