I migrated my DNN from one host to another, then spend several hours attempting to figure out why I was getting the error:
|
A critical error has occurred.
Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. |
This message led me down various paths regarding improper permissions, setting trust levels in the config file and a host of other dead-end issues. All the rest of the modules move just fine from one host to another -- just be sure to add the portal alias for the new host before you move the site, then change the connection string in the config file in two places (the FAQ and UsersOnLine modules haven't been updated to use the connection string section of the web.config file). All seems to work well, except that in each repository that you may have in the site, the help instructions indicate to use a fully qualified address for the location of the repository -- eg. C:\inetpub\domainname\Portals\0\Repository, so when you physically move the files along with the rest of the site to a new host environment, it likely isn't going to be in the same place on the new machine. As noted in this thread, once you know the problem, the solution is simple -- just change the settings on each repository to the new location address.
Oops, you say? How do you get the address from a shared environment? Try setting up another repository module on a test page. The proper path information will be placed in the settings for the new repository module. Just copy/paste those paths back to your live modules and the uploads in your repository will re-appear and the error message above will go away.
Should you find this as annoying as I did, then send feedback to the team to increase the priority of the bug noted in http://support.dotnetnuke.com/issue/ViewIssue.aspx?ID=7973&PROJID=22 -- the proposed solution is to set up relative rather than absolute paths (or at least build the absolute path in two parts -- one part picked up by the system - the c:\inetpub\domainname\Portals\0 part, then permit the user to add the variable aspect of the path \Repository or \Repository\Anonymous). Such a fix would be relatively straightforward in the code and then the module wouldn't be as brittle when moved between development, test, staging, production or into alternative hosted environments.
Brad