4.0.2.1: Error at \umbraco\presentation\default.aspx.cs: 68
Received an already built site and have a Visual Studio 2008 solution, which compiles fine. Just need to get Umbraco running on IIS7, running on Windows Server 2008 R2 64-bit. Site configured for ASP.NET 2.0. Deployed the "presentation" folder to the IIS directory.
Got the following after typing in the url in attempt to browse the site:
Can someone please shed some insight into this error?
if (m_tmp != "" && Request["umbPageID"] == null) { // Check numeric string tryIntParse = m_tmp.Replace("/", "").Replace(".aspx", string.Empty); int result; if (int.TryParse(tryIntParse, out result)) { m_tmp = m_tmp.Replace(".aspx", string.Empty);
// Check for request if (!string.IsNullOrEmpty(Request["umbVersion"])) { // Security check BasePages.UmbracoEnsuredPage bp = new BasePages.UmbracoEnsuredPage(); bp.ensureContext(); m_version = new Guid(Request["umbVersion"]); } } } else { if (!string.IsNullOrEmpty(Request["umbPageID"])) { int result; if (int.TryParse(Request["umbPageID"], out result)) { m_tmp = Request["umbPageID"]; } } }
if (m_version != Guid.Empty) { HttpContext.Current.Items["pageID"] = m_tmp.Replace("/", ""); m_umbPage = new page(int.Parse(m_tmp.Replace("/", "")), m_version); } else {
m_umbRequest = new requestHandler(content.Instance.XmlContent, m_tmp); Trace.Write("umbracoInit", "Done handling request"); if (m_umbRequest.currentPage != null) { HttpContext.Current.Items["pageID"] = m_umbRequest.currentPage.Attributes.GetNamedItem("id").Value;
// Handle edit if (editMode) { Document d = new Document(int.Parse(m_umbRequest.currentPage.Attributes.GetNamedItem("id").Value)); m_umbPage = new page(d.Id, d.Version); } else m_umbPage = new page(m_umbRequest.currentPage); } }
// set the friendly path so it's used by forms HttpContext.Current.RewritePath(HttpContext.Current.Items[requestModule.ORIGINAL_URL_CXT_KEY].ToString());
if (UmbracoSettings.UseAspNetMasterPages) { if (m_umbPage != null) this.MasterPageFile = template.GetMasterPageName(m_umbPage.Template);
First of all: make sure the network service has the appropriate modify permissions.
Second: does your site run on your local IIS? Check the settings for both environments, make sure they match.
Third: if all else fails, try to check (double check) that you've configured everything correctly, download the "vista" guide from the release page and see if you've missed something. http://umbraco.codeplex.com/releases/view/37337
You might want to consider upgrading to the .net 3.5 web.config as well, that one always seemed to work better for me.
Get the config file here: https://dl.dropbox.com/u/3006713/aspnet35.config, merge in the changes to your existing web.config file (using winmerge for example), rename this file to web.config and replace your existing web.config (and change your application pool to use integrate pipeline / .net 3.5 of course).
Even after merging the web.config I had with the aspnet35.config file, still got the error. Running IIS 7 in Classic mode works. Just one question: is anyone aware of an issue with this?
4.0.2.1: Error at \umbraco\presentation\default.aspx.cs: 68
Received an already built site and have a Visual Studio 2008 solution, which compiles fine. Just need to get Umbraco running on IIS7, running on Windows Server 2008 R2 64-bit. Site configured for ASP.NET 2.0. Deployed the "presentation" folder to the IIS directory.
Got the following after typing in the url in attempt to browse the site:
Can someone please shed some insight into this error?
Since it's running on .NET 2.0, I presume you've checked the application pool for that site is also 2.0?
Sometimes it's the simple things that get you stumped.
Let me know, and if not I'll see what else I can suggest
Yes, the application pool is 2.0, with Enable 32-Bit applications set to False.
Identity is NetworkService.
Hi Dom
Can you copy the full stack trace to here? The error isn't descriptive enough.
Thanks,
Richard
Dom
Can you also post the code from default.aspx.cs ?
This is the event handler where the problem occurs. The bit in bold is line 68.
void Page_PreInit(Object sender, EventArgs e)
{
Trace.Write("umbracoInit", "handling request");
bool editMode = UmbracoContext.Current.LiveEditingContext.Enabled;
if (editMode)
ValidateRequest = false;
if (m_tmp != "" && Request["umbPageID"] == null)
{
// Check numeric
string tryIntParse = m_tmp.Replace("/", "").Replace(".aspx", string.Empty);
int result;
if (int.TryParse(tryIntParse, out result))
{
m_tmp = m_tmp.Replace(".aspx", string.Empty);
// Check for request
if (!string.IsNullOrEmpty(Request["umbVersion"]))
{
// Security check
BasePages.UmbracoEnsuredPage bp = new BasePages.UmbracoEnsuredPage();
bp.ensureContext();
m_version = new Guid(Request["umbVersion"]);
}
}
}
else
{
if (!string.IsNullOrEmpty(Request["umbPageID"]))
{
int result;
if (int.TryParse(Request["umbPageID"], out result))
{
m_tmp = Request["umbPageID"];
}
}
}
if (m_version != Guid.Empty)
{
HttpContext.Current.Items["pageID"] = m_tmp.Replace("/", "");
m_umbPage = new page(int.Parse(m_tmp.Replace("/", "")), m_version);
}
else
{
m_umbRequest = new requestHandler(content.Instance.XmlContent, m_tmp);
Trace.Write("umbracoInit", "Done handling request");
if (m_umbRequest.currentPage != null)
{
HttpContext.Current.Items["pageID"] = m_umbRequest.currentPage.Attributes.GetNamedItem("id").Value;
// Handle edit
if (editMode)
{
Document d = new Document(int.Parse(m_umbRequest.currentPage.Attributes.GetNamedItem("id").Value));
m_umbPage = new page(d.Id, d.Version);
}
else
m_umbPage = new page(m_umbRequest.currentPage);
}
}
// set the friendly path so it's used by forms
HttpContext.Current.RewritePath(HttpContext.Current.Items[requestModule.ORIGINAL_URL_CXT_KEY].ToString());
if (UmbracoSettings.UseAspNetMasterPages)
{
if (m_umbPage != null)
this.MasterPageFile = template.GetMasterPageName(m_umbPage.Template);
initUmbracoPage();
}
}
Hi Dom
I have to be honest and say I don't know what's causing that.
I've tweeted out a link to see if anyone else in the community can help you.
Richard
First of all: make sure the network service has the appropriate modify permissions.
Second: does your site run on your local IIS? Check the settings for both environments, make sure they match.
Third: if all else fails, try to check (double check) that you've configured everything correctly, download the "vista" guide from the release page and see if you've missed something. http://umbraco.codeplex.com/releases/view/37337
You might want to consider upgrading to the .net 3.5 web.config as well, that one always seemed to work better for me.
Get the config file here: https://dl.dropbox.com/u/3006713/aspnet35.config, merge in the changes to your existing web.config file (using winmerge for example), rename this file to web.config and replace your existing web.config (and change your application pool to use integrate pipeline / .net 3.5 of course).
The site runs on the Visual Studio development server and the default page loads ok. Web.config on the testing server is from Visual Studio.
However, changing IIS 7 on the testing server to run in Classic rather than Integrated mode has solved the problem.
Even after merging the web.config I had with the aspnet35.config file, still got the error. Running IIS 7 in Classic mode works. Just one question: is anyone aware of an issue with this?
Nope, classic mode should be just fine, not to worry.
is working on a reply...