When I copy my application to the test webserver the error is gone. I would really like to use the Web Deployment Project. I've found the following article; http://jlchereau.blogspot.com/2008/12/argumentnullexception-raised-by-profile.html but the given suggestion in the article doesn't solve the error. Does anyone know a solution for this?
When you deployed your ASP.NET website, did you install the assembly that is in GAC in server's GAC or copy this assembly to your ASP.NET website's Bin folder? When we precompile ASP.NET website, the referred assembly, which is in GAC, won't be copied to
Bin folder.
So please insert that assembly in server's GAC or copy it to your ASP.NET website's Bin folder.
Since you are using Web Deployment project, you can try to enable or disable "allow this precompiled site to be updatable".
I look forward to receiving your test results.
Thomas Sun
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
I did add the assemly to the servers GAC. I also tried enabling and disabling the "Allow this precompiled site to be updatable" setting, it makes no difference.
I've also tested the application on my local machine, which also has the assembly installed in the GAC. The non compiled website works fine, the precompiled throws the error.
Is there a way that I can debug the precompiled website and the assembly in the GAC? Or does someone have any other suggestions?
Did you get any error message in Windows Event Viewer which records the error of the application in the Application section?
Thomas Sun
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
Process information:
Process ID: 684
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: HttpParseException
Exception message: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\cms\e4611f61\71ec0278\App_Web__basicmaster.master.cdcab7d2.vzqsp6ma.0.cs(125): error CS0246: The type or namespace name 'ProfileCommon' could not be found (are you
missing a using directive or an assembly reference?)
Request information:
Request URL:
http://grondtransacties.nl/cms/login.aspx?ReturnUrl=A parser error has occurred.fcmsA parser error has occurred.fsiteexplorer.aspx
Request path: /cms/login.aspx
User host address: 192.168.0.40
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.UI.TemplateParser.ProcessException(Exception ex)
at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseReader(StreamReader reader, VirtualPath virtualPath)
at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
at System.Web.UI.TemplateParser.ParseInternal()
at System.Web.UI.TemplateParser.Parse()
at System.Web.UI.TemplateParser.Parse(ICollection referencedAssemblies, VirtualPath virtualPath)
at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
We are also having this problem. We have a custom profile and a precompiled site.
Using reflector I dug into the framework to see what was going on. The null parameter for type error you are getting is caused by a call in System.Web.Profile.ProfileBase.CreateMyInstance. It calls BuildManager.GetProfileType(). That call is returning
null. It is returning a member variable _profileType. This value gets set by a call to EnsureTopLevelFilesCompiled. I would expect that this function's behavior is different in a precompiled site which causes the _profileType to never get set.
I am still trying to fix it, but thought I would post here as well for any help anyone can offer.
martijnvm
Member
11 Points
51 Posts
Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
May 12, 2009 07:57 AM|LINK
Hello all,
In the GAC I have an assembly with my custom Profile provider and my custom type derived from ProfileBase.
When I deploy my application with a Web Deployment Project I get the following error:
Vimpyboy
Contributor
3212 Points
651 Posts
MVP
Re: Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
May 12, 2009 08:35 PM|LINK
Hi Martijn,
Have you tried to debug the dll to see where it is null?
http://weblogs.asp.net/mikaelsoderstrom
http://www.twitter.com/vimpyboy
Thomas Sun –...
All-Star
64969 Points
5621 Posts
Re: Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
May 14, 2009 07:44 AM|LINK
Hi,
When you deployed your ASP.NET website, did you install the assembly that is in GAC in server's GAC or copy this assembly to your ASP.NET website's Bin folder? When we precompile ASP.NET website, the referred assembly, which is in GAC, won't be copied to Bin folder.
So please insert that assembly in server's GAC or copy it to your ASP.NET website's Bin folder.
Since you are using Web Deployment project, you can try to enable or disable "allow this precompiled site to be updatable".
I look forward to receiving your test results.
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
martijnvm
Member
11 Points
51 Posts
Re: Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
May 20, 2009 01:53 PM|LINK
Hi Thomas,
Thank you for your reply.
I did add the assemly to the servers GAC. I also tried enabling and disabling the "Allow this precompiled site to be updatable" setting, it makes no difference.
I've also tested the application on my local machine, which also has the assembly installed in the GAC. The non compiled website works fine, the precompiled throws the error.
Is there a way that I can debug the precompiled website and the assembly in the GAC? Or does someone have any other suggestions?
Martijn
Thomas Sun –...
All-Star
64969 Points
5621 Posts
Re: Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
May 21, 2009 03:28 AM|LINK
Hi,
Thanks for your response.
Did you get any error message in Windows Event Viewer which records the error of the application in the Application section?
Microsoft Online Community Support
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.
martijnvm
Member
11 Points
51 Posts
Re: Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
May 26, 2009 01:54 PM|LINK
Hi Thomas,
The following warning is in the Application section of the Event Viewer:
Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1310
Date: 5/26/2009
Time: 3:51:08 PM
User: N/A
Computer: MCW3-DEV
Description:
Event code: 3006
Event message: A parser error has occurred.
Event time: 5/26/2009 3:51:08 PM
Event time (UTC): 5/26/2009 1:51:08 PM
Event ID: 5af29792b9854174b15eb19c4c238f8c
Event sequence: 6
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1942446184/ROOT/cms-1-128878194658593750
Trust level: Full
Application Virtual Path: /cms
Application Path: D:\www\- Cms\
Machine name: MCW3-DEV
Process information:
Process ID: 684
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: HttpParseException
Exception message: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\cms\e4611f61\71ec0278\App_Web__basicmaster.master.cdcab7d2.vzqsp6ma.0.cs(125): error CS0246: The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?)
Request information:
Request URL: http://grondtransacties.nl/cms/login.aspx?ReturnUrl=A parser error has occurred.fcmsA parser error has occurred.fsiteexplorer.aspx
Request path: /cms/login.aspx
User host address: 192.168.0.40
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 1
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Web.UI.TemplateParser.ProcessException(Exception ex)
at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseReader(StreamReader reader, VirtualPath virtualPath)
at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
at System.Web.UI.TemplateParser.ParseInternal()
at System.Web.UI.TemplateParser.Parse()
at System.Web.UI.TemplateParser.Parse(ICollection referencedAssemblies, VirtualPath virtualPath)
at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Does this help?
Martijn
martijnvm
Member
11 Points
51 Posts
Re: Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
Jun 02, 2009 02:37 PM|LINK
Does anyone have an idea how to fix this?
Martijn
stoneym
Member
117 Points
25 Posts
Re: Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
Feb 25, 2010 02:25 PM|LINK
Did you get this fixed?
We are also having this problem. We have a custom profile and a precompiled site.
Using reflector I dug into the framework to see what was going on. The null parameter for type error you are getting is caused by a call in System.Web.Profile.ProfileBase.CreateMyInstance. It calls BuildManager.GetProfileType(). That call is returning null. It is returning a member variable _profileType. This value gets set by a call to EnsureTopLevelFilesCompiled. I would expect that this function's behavior is different in a precompiled site which causes the _profileType to never get set.
I am still trying to fix it, but thought I would post here as well for any help anyone can offer.
Thanks.
martijnvm
Member
11 Points
51 Posts
Re: Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
Apr 09, 2010 09:53 AM|LINK
We decided not to use the Web Deployment Project.
groblerf
Member
14 Points
2 Posts
Re: Web Deployment Project and Profiles and custom ProfileBase derived type in the GAC
Feb 22, 2013 10:17 AM|LINK
Hava a look at: http://www.codeproject.com/Tips/86616/Fixing-ArgumentNullException-When-Using-the-ASP-Ne
This might help resolve your issues in the future.