Problem changing to medium trust

Post here for help with installing or upgrading mojoPortal pre-compiled release packages. When posting in this forum, please provide all relevant details. You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

Post here for help with installation of mojoPortal pre-compiled release packages

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.

You may also want to review the installation or upgrading documentation.

If you have questions about using the source code or working with mojoPortal in Visual Studio, please post in the Developer forum.

This thread is closed to new posts. You must sign in to post in the forums.
3/1/2015 1:36:33 PM
Gravatar
Total Posts 18

Problem changing to medium trust

I did try to change to medium trust on mojoPortal 2.4.0.3 MSSQL. I did see

https://www.mojoportal.com/mediumtrust.aspx

But I do not find file Web.mediumtrust.config

I get error

Cannot subset Regex. Only support if both patterns are identical.

What is the problem?

 

3/2/2015 8:29:18 AM
Gravatar
Total Posts 18439

Re: Problem changing to medium trust

That article was out of date, I have added a note to it saying it is legacy information. We no longer use NeatUpload and we no longer ship or require a separate web.config setup for medium trust.

please describe the steps to produce the error and post the stack trace of the error

3/2/2015 10:32:39 AM
Gravatar
Total Posts 18

Re: Problem changing to medium trust

I did just install mojoPortal version listed above - new installation empty database. Then I did change on IIS to medium trust.

Stack trace:

Cannot subset Regex. Only support if both patterns are identical.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: Cannot subset Regex. Only support if both patterns are identical.

Source Error:
 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[NotSupportedException: Cannot subset Regex. Only support if both patterns are identical.]

System.Net.WebPermission.IsSubsetOf(IPermission target) +834 System.Security.PermissionSet.IsSubsetOfHelper(PermissionSet target, IsSubsetOfType type, IPermission& firstPermThatFailed, Boolean ignoreNonCas) +10136797 System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +10246364 System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +97 [FileLoadException: Could not load file or assembly 'DotNetOpenAuth, Version=3.1.0.9122, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)] System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0 System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +416 System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +166 System.Reflection.Assembly.Load(String assemblyString) +35 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +190 [ConfigurationErrorsException: Could not load file or assembly 'DotNetOpenAuth, Version=3.1.0.9122, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +11326376 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +388 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +232 System.Web.Configuration.AssemblyInfo.get_AssemblyInternal() +48 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +210 System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +76 System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +11315554 System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +551 [HttpException (0x80004005): Could not load file or assembly 'DotNetOpenAuth, Version=3.1.0.9122, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +76 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +1012 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +1025 [HttpException (0x80004005): Could not load file or assembly 'DotNetOpenAuth, Version=3.1.0.9122, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11420374 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +11293864

3/2/2015 10:34:38 AM
Gravatar
Total Posts 18

Re: Problem changing to medium trust

P.S.

I use .NET 3.5 version, because of this version is last supported: mojoPortal 2.4.0.3 MSSQL

And it works on full trust

3/2/2015 10:58:46 AM
Gravatar
Total Posts 18439

Re: Problem changing to medium trust

The error comes from DotNetOpenAuth, I recommend disable that, if you want to use openid use Janrain instead.

UPDATE mp_Sites
SET AllowOpenIDAuth = 0

then touch web.config to clear the sitesettings cache

3/2/2015 2:41:03 PM
Gravatar
Total Posts 18

Re: Problem changing to medium trust

It was allready set to 0

select AllowOpenIDAuth from mp_Sites

returns

AllowOpenIDAuth
0

 

3/2/2015 2:42:39 PM
Gravatar
Total Posts 18

Re: Problem changing to medium trust

I forget to write it - I still get error.

3/2/2015 2:48:26 PM
Gravatar
Total Posts 18439

Re: Problem changing to medium trust

I would try delete the dotnetopenauth.dll from the bin folder, if that fails to solve it I have no other ideas, other than change to .net 4.5 hosting, sorry.

3/2/2015 3:02:47 PM
Gravatar
Total Posts 18

Re: Problem changing to medium trust

Yes, deleting of

dotnetopenauth.dll

did help. This was test site. Now I will try production ...

Thanks for the help.

3/3/2015 8:20:12 AM
Gravatar
Total Posts 18439

Re: Problem changing to medium trust

glad to hear that worked, I thought it would but wasn't 100% sure.

Thanks for the beer!

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.