Julian Hansen
asked on
Compilation Error: The type 'ProfileCommon' exists in both ... ???
We have a site that has been up and running for a while. Out of nowhere this error started appearing when trying to access the site.
CS0433: The type 'ProfileCommon' exists in both 'c:\windows\Microsoft.NET\ Framework\ v2.0.50727 \Temporary ASP.NET Files\root\cf2b8434\95f525 a3\App_Cod e.0i70ivrk .dll' and 'c:\windows\Microsoft.NET\ Framework\ v2.0.50727 \Temporary ASP.NET Files\root\cf2b8434\95f525 a3\assembl y\dl3\ec82 ca57\4c212 851_fe6ecd 01\App_Cod e.DLL'
Has anyone had any experience with this
CS0433: The type 'ProfileCommon' exists in both 'c:\windows\Microsoft.NET\
Has anyone had any experience with this
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think that would not be possible on hosted server.
But I found a link that describe your problem :
http://gregorybeamer.wordpress.com/2008/09/26/solving-the-profilecommon-ambiguous-error/
But I found a link that describe your problem :
http://gregorybeamer.wordpress.com/2008/09/26/solving-the-profilecommon-ambiguous-error/
Just a hunch; I'd be inclined to suspect an applicationName conflict in the web.config.
<add name="AspNetSqlProfileProv ider" type="System.Web.Profile.S qlProfileP rovider" connectionStringName="mycn " applicationName="/" />
Most people deploy their apps using the "/" as the application name, which leaves it up to IIS to figure it out.
Try:
<add name="AspNetSqlProfileProv ider" type="System.Web.Profile.S qlProfileP rovider" connectionStringName="mycn " applicationName="/mywebsit e" />
Alan
<add name="AspNetSqlProfileProv
Most people deploy their apps using the "/" as the application name, which leaves it up to IIS to figure it out.
Try:
<add name="AspNetSqlProfileProv
Alan
ASKER
Thanks Alan,
The application name was set to the application name i.e. not '/'. As an added test I changed it to something else - same problem.
The error points to this bit of code
The application name was set to the application name i.e. not '/'. As an added test I changed it to something else - same problem.
The error points to this bit of code
Line 125: protected ProfileCommon Profile {
Line 126: get {
Line 127: return ((ProfileCommon)(this.Context.Profile));
Line 128: }
Line 129: }
The web config does define a custom profile provider like so - I did read somewhere that something in this could be the problem - but not sure how to proceed .... <membership defaultProvider="AspNetSqlMembershipProvider">
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="connect"
enablePasswordRetrieval="true"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
requiresQuestionAndAnswer="False"
passwordFormat="Clear"
applicationName="UniqueApplicationNameChangedForEEPost" />
</providers>
</membership>
<profile defaultProvider="MyCustomProfileProvider">
<providers>
<clear/>
<add name="MyCustomProfileProvider"
connectionStringName="connect"
type="Microsoft.SqlTableProfileProvider"
table="Member"
profileVersion="1"
applicationName="UniqueApplicationNameChangedForEEPost" />
</providers>
<properties>
<add name="MemberId" type="int" defaultValue=" " customProviderData="MemberId;int" />
<add name="MembershipTypeId" type="int" defaultValue=" " customProviderData="MembershipTypeId;int" />
<add name="CountryId" type="int" defaultValue="" customProviderData="CountryId;int" />
<add name="StateId" type="int" defaultValue="" customProviderData="StateId;int" />
<add name="GenderId" type="int" defaultValue="" customProviderData="GenderId;int" />
<add name="PaymentSubscriptionId" type="int" defaultValue="0" customProviderData="PaymentSubscriptionId;int" />
<add name="Firstname" type="string" defaultValue=" " customProviderData="Firstname;nvarchar" />
<add name="Surname" type="string" defaultValue=" " customProviderData="Surname;nvarchar" />
<add name="EmailAddress" type="string" defaultValue=" " customProviderData="EmailAddress;nvarchar" />
<add name="DateOfBirth" type="datetime" defaultValue=" " customProviderData="DateOfBirth;datetime" />
<add name="ProfileImageLocation" type="string" defaultValue=" " customProviderData="ProfileImageLocation;nvarchar" />
<add name="ZipCode" type="string" defaultValue=" " customProviderData="ZipCode;nvarchar" />
<add name="LastUpdatedDate" type="datetime" defaultValue="[getdate()]" customProviderData="LastUpdatedDate;datetime" />
<add name="CreatedDate" type="datetime" defaultValue="[getdate()]" customProviderData="CreatedDate;datetime" />
<add name="IsActive" type="bool" defaultValue="[1]" customProviderData="IsActive;bit" />
</properties>
</profile>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Apologies for not following up guys.
Have not solved the problem - having to work on it part time.
I suspect the answer is in one of the posts above so going to assign points now and post back when problem is solved.
Have not solved the problem - having to work on it part time.
I suspect the answer is in one of the posts above so going to assign points now and post back when problem is solved.
WOW we've solved this..
For me the issue was because I was deleting the PrecompiledApp.config file
when I deployed the app. Apparently that file tells the .Net runtime that
the app is already compiled and not to recompile it again. Without the file
the runtime tries to compile the app again conflicts arise.
Once I put the file back in and redeployed everything worked fine.
Regards,
Karunaker
For me the issue was because I was deleting the PrecompiledApp.config file
when I deployed the app. Apparently that file tells the .Net runtime that
the app is already compiled and not to recompile it again. Without the file
the runtime tries to compile the app again conflicts arise.
Once I put the file back in and redeployed everything worked fine.
Regards,
Karunaker
ASKER
Thanks Karunaker - will give this a try as soon as we are back in the office. For now we are running off the uncompiled source which is working but not ideal.
ASKER