When in the web config file there are some profile's properties the deploied web dll will generate the following error:
CS0433: The type 'ProfileCommon' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\7b6d6116\c98e92b8\assembly\dl3\c65d681f\4c71788f_4091c601\xxxxxxxxxxx.DLL' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\7b6d6116\c98e92b8\App_Code.huffczir.dll'
That because .NET try as usual to create the ProfileCommon class on the runtime with the properties specified in the web config file, but the web deploied dll contains already a ProfileCommon class!
To avoid this error you can remove all the profile properties from the web config file on the live / productive server, so .NET will not try to generate the ProfileCommon class, but this is not the expected solution, also because for the user profile will not used the ProfileCommon class in the web deploied dll but the usual DefaultProfile class.
Or you can remove all the profile properties from the web config file before create the web deploy dll, and so the deploied dll will not contain the ProfileCommon class, and .NET can generate it on the runtime with the specified properties in the web config file.
But everytime remove all the profile's properties before compile the web deploy project and add them again after it is a quite annoying task!
Partager