// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
+
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
}
CodeDomProvider provider = null;
- CompilationSection compilationSection = WebConfigurationManager.GetSection ("system.web/compilation") as CompilationSection;
+ CompilationSection compilationSection = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
if (compilerInfo == null) {
if (!CodeDomProvider.IsDefinedLanguage (compilationSection.DefaultLanguage))
throw new HttpException ("Failed to retrieve default source language");
if (file == null || file.Length == 0 || buildProviders == null || buildProviders.Count == 0)
return null;
- BuildProvider ret = buildProviders.GetProviderForExtension (Path.GetExtension (file));
+ BuildProvider ret = buildProviders.GetProviderInstanceForExtension (Path.GetExtension (file));
if (ret != null && IsCorrectBuilderType (ret)) {
ret.SetVirtualPath (PhysicalToVirtual (file));
return ret;
bool ProcessAppCodeDir (string appCode, AppCodeAssembly defasm)
{
// First process the codeSubDirectories
- CompilationSection cs = (CompilationSection) WebConfigurationManager.GetSection ("system.web/compilation");
+ CompilationSection cs = (CompilationSection) WebConfigurationManager.GetWebApplicationSection ("system.web/compilation");
if (cs != null) {
string aname;
{
if (ps == null || !ps.Enabled)
return false;
- if (!String.IsNullOrEmpty (ps.Inherits) || (ps.PropertySettings != null && ps.PropertySettings.Count > 0))
+
+ RootProfilePropertySettingsCollection props = ps.PropertySettings;
+ ProfileGroupSettingsCollection groups = props != null ? props.GroupSettings : null;
+
+ if (!String.IsNullOrEmpty (ps.Inherits) || (props != null && props.Count > 0) || (groups != null && groups.Count > 0))
return true;
return false;
return;
string appCode = Path.Combine (HttpRuntime.AppDomainAppPath, "App_Code");
- ProfileSection ps = WebConfigurationManager.GetSection ("system.web/profile") as ProfileSection;
+ ProfileSection ps = WebConfigurationManager.GetWebApplicationSection ("system.web/profile") as ProfileSection;
bool haveAppCodeDir = Directory.Exists (appCode);
bool haveCustomProfile = HaveCustomProfile (ps);
} else
return;
- if (HttpApplication.LoadTypeFromBin (providerTypeName) == null)
- throw new HttpException (String.Format ("Profile provider type not found: {0}",
- providerTypeName));
+ Exception noTypeException = null;
+ Type ptype = null;
+
+ try {
+ ptype = HttpApplication.LoadTypeFromBin (providerTypeName);
+ } catch (Exception ex) {
+ noTypeException = ex;
+ }
+
+ if (ptype == null)
+ throw new HttpException (String.Format ("Profile provider type not found: {0}", providerTypeName), noTypeException);
}
}
}
}
}
-#endif
+