I've unpacked the DNN 4.0.2 source edition, configured the IIS and modified the connection string to use a SQL 2005 Developer Instance.
When I build the solution and runs it, it starts installation process, but fails with a System.Security.SecurityException when trying to add host user and admin user.
The exception info is as follows:
System.Security.SecurityException was caught
Message="Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
Source="mscorlib"
StackTrace:
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.IO.Path.GetFullPath(String path)
at System.Web.Util.FileUtil.IsSuspiciousPhysicalPath(String physicalPath, Boolean& pathTooLong)
at System.Web.Util.FileUtil.IsSuspiciousPhysicalPath(String physicalPath)
at System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path)
at System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath)
at System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull)
at System.Web.CachedPathData.GetConfigPathData(String configPath)
at System.Web.CachedPathData.GetConfigPathData(String configPath)
at System.Web.Security.Membership.Initialize()
at System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status)
at System.Web.Security.Membership.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, MembershipCreateStatus& status)
at DotNetNuke.Entities.Users.UserController.AddUser(UserInfo objUser, Boolean AddToMembershipProvider) in c:\Work Space\VS 2005\DotNetNuke\Library\Components\Users\UserController.vb:line 509
The exception is generated by the last line in the following sequence (taken from UserController.vb)
Dim objMembershipUser As AspNetSecurity.MembershipUser
Dim fiop As System.Security.Permissions.FileIOPermission = New System.Security.Permissions.FileIOPermission(System.Security.Permissions.PermissionState.Unrestricted)
fiop.AddPathList(System.Security.Permissions.FileIOPermissionAccess.AllAccess, ApplicationMapPath)
fiop.AllFiles = System.Security.Permissions.FileIOPermissionAccess.AllAccess
fiop.AllLocalFiles = System.Security.Permissions.FileIOPermissionAccess.AllAccess
fiop.Assert()
objMembershipUser = AspNetSecurity.Membership.CreateUser(objSecurity.InputFilter(objUser.Membership.Username, PortalSecurity.FilterFlag.NoScripting Or PortalSecurity.FilterFlag.NoMarkup), objUser.Membership.Password, objSecurity.InputFilter(objUser.Membership.Email, PortalSecurity.FilterFlag.NoScripting Or PortalSecurity.FilterFlag.NoMarkup), Nothing, Nothing, objUser.Membership.Approved, objStatus)
The first line and the second line is DNN Original source - the other lines are added by me trying to circumvent the exception.
What is the problem?
I've made no changes to machine.config. I'm trying to run the site in medium trust. If I set it to full trust, no exception is thrown.