BugNET

Open source issue tracking & project management

Forums

HomeHomeSupportSupportInstalling BugN...Installing BugN...Medium TrustMedium Trust
Previous
 
Next
New Post
4/9/2010 10:50 AM
 

I had a google and I can see that 0.8 may get around the Medium Trust problems with earlier versions. As my hoster (Rackspace) is medium Trust, this is a key issue for me.

I can see that you've no chance in Medium Trust with the install, which seems to need Read/Write to Web.config which you're definitately not going to get. I can get around that though... install it using a test (none-hosted, full trust) IIS install, then run it on the Medium Trust host, pointing at the database created off the original install and using a deployed version of the BugNet files. With me so far?

Well anyway, let's keep it simple. I install on IIS7/ Win 7 as per the instructions. As you'll know the file permissions are different for Win7/IIS - broadly you need to add IIS_IUSRS with full permissions, and explicitly unset the write-protect on the various /config backup files. Not sure what that is but it's done. That works and I can get into it and it looks ok.

Next, on the same machine set the trust level down to Medium... in your system.web section stick:

<trust level="Medium" />

And kerang, it piles into the ground on page refresh with an interesting error as below. Anyone know what "DotNetOpenAuth" is, and why it's after full trust? If so, has anyone hacked around this?

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

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) +10128557
   System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +10238060
   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.2.2.9257, 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.2.2.9257, 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) +11207304
   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) +11196482
   System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +185
   System.Web.Compilation.BuildManager.CompileCodeDirectories() +654
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +658

[HttpException (0x80004005): Could not load file or assembly 'DotNetOpenAuth, Version=3.2.2.9257, 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.2.2.9257, Culture=neutral, PublicKeyToken=2780ccd10d57b246' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11301302
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4338644

 
New Post
4/9/2010 11:59 AM
 

DotnetOpenAuth is the open id provider used in BugNET.

"The default medium trust does not allow OpenID to function, since it disallows outgoing HTTP requests. However, some shared hosters like GoDaddy have modified WebPermission in Medium trust to allow outbound http and https traffic"

We are using an older version of dotnetopenauth. On their site they say "Works in partial trusted shared hosting environments." and it may be fixed now. www.dotnetopenauth.net/


Davin Dubeau

follow us on twitter facebook users group google plus
 
New Post
4/10/2010 9:34 AM
 

thanks... ok, I don't really need or want that - I have an asp.net membership provider and I'll use that to guard access to this, and not use any local user database. So I'll see if I can hack it out.

As you say, it may be fixed... but I'm saying to myself the samething about BugNet ;-) and there's a limit to how deep I want to follow that thread. I'll try to hack it out.

--- update

Well the good news is that just taking the DLL out of the bin directory and hacking the references to it out of the Login.aspx page seems to get past that one. So far so good - I'll play around with it some more to see if it falls over with anything else in Medium, then try to deploy it to Rackspace Cloud and see if it'll work there.

---

Slightly off topic: I see there's a membership provider in there but it's described as "extended" ... so it won't work with a standard asp.net membership provider I assume?

 
New Post
4/11/2010 2:56 AM
 

1 BugNET 0.8.167.0 (RC2) and Medium Trust

Ok, so removing the OpenID stuff worked fine: that's your only component which requires full trust as far as I can tell I ran the system and inserted/ managed a number of test defects without trouble under Medium Trust. Problem solved.

2 As a Web Application under Win7/iis7

I then set BugNet up as an application "under" an existing IIS7 site on my local Win 7 test server. I had to hack a couple of things in the web.config to make that work:

  1. I had to restore the default web.sitemap as the sitemap provider (I override that in my parent site).
  2. I had to explicitly "clear" the ELMAH definitions from my parent site as they caused trouble here.
  3. I had to remove the "clear" from the connectionStrings section as that caused problems with LocalSQLserver or some such.

Having done that, the whle package (parent web site and BugNet as application within it on IIS7/ Win7) works fine. Oh, you have to change the way the application pool behaves in Win7 (this is common for other things too - you get a security exception until you change it).

So far so good... now to try it on Rackspace Cloud...

--- update

Rock 'n' Roll... live and kicking on Rackspace Cloud, the first asp.net defect tracker I've managed to get working there. Thanks!

There was one more tweak required to make it fly there, add this to the BugNet web.config (I use mappings in the parent site):

<urlMappings enabled="false" />

 
New Post
4/12/2010 8:27 AM
 
philw wrote:

1 BugNET 0.8.167.0 (RC2) and Medium Trust

Ok, so removing the OpenID stuff worked fine: that's your only component which requires full trust as far as I can tell I ran the system and inserted/ managed a number of test defects without trouble under Medium Trust. Problem solved.

2 As a Web Application under Win7/iis7

I then set BugNet up as an application "under" an existing IIS7 site on my local Win 7 test server. I had to hack a couple of things in the web.config to make that work:

  1. I had to restore the default web.sitemap as the sitemap provider (I override that in my parent site).
  2. I had to explicitly "clear" the ELMAH definitions from my parent site as they caused trouble here.
  3. I had to remove the "clear" from the connectionStrings section as that caused problems with LocalSQLserver or some such.

Having done that, the whle package (parent web site and BugNet as application within it on IIS7/ Win7) works fine. Oh, you have to change the way the application pool behaves in Win7 (this is common for other things too - you get a security exception until you change it).

So far so good... now to try it on Rackspace Cloud...

--- update

Rock 'n' Roll... live and kicking on Rackspace Cloud, the first asp.net defect tracker I've managed to get working there. Thanks!

There was one more tweak required to make it fly there, add this to the BugNet web.config (I use mappings in the parent site):

Glad to hear you got it working!

I will be improving the installation to further support medium trust. I also updated the DotNetOpenAuth component yesterday and tried running as medium trust and I did not receive any errors so that is a good sign as well but probably requires further testing.


Davin Dubeau

follow us on twitter facebook users group google plus
 
Previous
 
Next
HomeHomeSupportSupportInstalling BugN...Installing BugN...Medium TrustMedium Trust


Forum Policy

These Discussion Forums are dedicated to the discussion of the BugNET issue tracker.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:
1. No Advertising.
2. No Flaming or Trolling.
3. No Profanity, Racism, or Prejudice.
4. Site Moderators have the final word on approving/removing a thread or post or comment.
5. English language posting only, please.