Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 04, 2011 11:29 PM by 21a1ss3
Apr 30, 2006 12:13 PM|LINK
I'm creating a multi-lingual web site using ASP.NET 2.0. So far no login required. Everything has been working fine while developing and test via VS 2005 on Windows XP Pro. But whn I compile and publish the site the Win 2003 Server throws the error
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30554: 'ProfileCommon' is ambiguous.
Line 54: End Sub
Line 56: Protected ReadOnly Property Profile() As ProfileCommon
Line 57: Get
Line 58: Return CType(Me.Context.Profile,ProfileCommon)
Line 54: End Sub
Source File: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\a9f6a360\6a92c38a\App_Web_default.aspx.cdcab7d2.tal-5bet.0.vb
The master page includes the main menu and the user options to specify the language of choice:
"?" + Request.QueryString);
void imgBtnFrancais_Click(object sender,
Profile.UICulture = "fr-FR";
the code behind files the incorporate the master page file include:
and the web.config file includes:
Please can you help to determine why I'm receiving this error once the site has been compiled an published.
Apr 30, 2006 01:54 PM|LINK
Try using a fully qualified namespace where you reference a ProfileCommom type. The compiler is finding more than one ProfileCommon type and that is the reason for the error.
Protected ReadOnly Property Profile() As
You get the idea. That should help.
Apr 30, 2006 02:00 PM|LINK
One more thing. Try compiling for release mode (if you did not do that already).
Apr 30, 2006 02:09 PM|LINK
Thanks for your reply. Regarding your first post, it makes perfect sense to me but the problem is that I have not referenced ProfileCommon from anywhere in my project. As I'm aware, this is an auto-generated class so I guess somewhere, somehow this class
is being created twice?
I'm a newbie and not that familiar with compiling in release mode. I've been precompiling the entire site using aspnet_complier, is this the same as compiling in release mode, if not how can I perform this?
Apr 30, 2006 03:33 PM|LINK
I'm still having problems with this. I've examined the master page and default.aspx.cs files, removed some code and performed some tests and I still get the same error. I'm fairly sure that the problem does not arise from these two files. Could it be:
1) the web.config file configuration, do I need to add anything specific;
2) IIS 6.0, configuration and/or
3) SQL Server 2005?
Is it possible to override the ProfileCommon class or at least force the application to use a specific ProfileCommon class (i.e by adding adding the namespace?)
Should I add anything to the Global.asax file?
Please can you provide some hints for me.
May 01, 2006 04:41 PM|LINK
May 01, 2006 04:45 PM|LINK
May 01, 2006 10:41 PM|LINK
Thanks again James for your assistance. I've cracked it though. Unfortunately the error messages I was receiving weren't providing enough clues (for me) to find the root of the problem easily enough but fortunately the solution was very simple to implement
once I had an idea of the problem.
I started a new project and pieced it together bit by bit using the files from my previous project (the one giving the errors) just until I started to receive my first error, which was...
"Failed to generate a user instance of SQL Server due to failure in retrieving the user's local
application data path. Please make sure the user has a local user profile on the computer. The
connection will be closed."
This occured when my localisation code was added (as expected)
I googled this error and found out the problem relates to the SQL Express instance that was being automatically generated, as well as the local user name on the server.
Then I read a post at
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=125227&SiteID=1 by a member that cracked it on the head for me. I didn't follow his instructions completely since my set up was different than his but I used the suggested aspnet_regsql utility to register
my existing sql server 2005 db to be used by the profile provider and VOILA!! the errors disappeared.
Also I added to web.config file :
<add name="LocalSqlServer" connectionString="data source=xxx.xxx.xxx.xxx\sqlexpress;Initial Catalog=myDB;User ID=user;Password=pass"/>
May 01, 2006 11:06 PM|LINK
May 04, 2007 12:34 AM|LINK
The main thing to take away from that as as side post here as this article is fairly old. Is that there is a another version of the file that the compiler is seeing with the same name. That is why its ambigous....