Last post Oct 20, 2006 11:47 AM by Russ Helfand
Oct 18, 2006 12:08 PM|Evarest|LINK
I have used a .browser file to attach adapters to some of the default ASP .NET Controls. The browser file resides in
I also use a Global.asax which for now doesn't contain any real code:
Global : System.Web.HttpApplication
However, if i try to run my application, i get the following runtime error:
Server Error in '/DICOM2' Application.
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The type 'CSSFriendly.ChangePasswordAdapter' is ambiguous: it could come from assembly 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\dicom2\dd285262\a1be64c6\App_Code.lnei5vxa.DLL' or from assembly 'C:\Inetpub\wwwroot\DICOM2\bin\DICOM2.DLL'.
Please specify the assembly explicitly in the type name.
Line 2: <browser refID="Default">
Line 3: <controlAdapters>
Line 4: <adapter controlType="System.Web.UI.WebControls.ChangePassword"
Line 5: adapterType="CSSFriendly.ChangePasswordAdapter" />
Line 6: <adapter controlType="System.Web.UI.WebControls.Login"
Source File: C:\Inetpub\wwwroot\DICOM2\App_Browsers\CSSFriendlyAdapters.browser Line: 4
I want to stress that if i either remove the .browser file, or the Global.asax file, all works fine. (?!)
There appears to be some conflict between .browser files and Global.asax files?
How can i make this work?
Oct 18, 2006 12:38 PM|Russ Helfand|LINK
I don't know for sure... but... it looks like you may have build a DLL for your web site. I'm guessing that you built a file called DICOM2.dll as a web project. Is that right? If so, did you happen to have the adapters in the App_Code folder at the time?
If so, then they probably got added to DICOM2.dll so they are defined and live in that DLL. However, prior to having built that DLL you have have been running the usual mode for an ASP.NET web site wherein the .Net framework builds the site's DLLs on-the-fly.
Those files get put into subfolders of C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files. You can get into weird situations, therefore, where the cached pre-compiled DLLs in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files clash with whatever DLLs you've put in your site's bin folder. For example, both sets of DLLs could end up containing a definition for each of the CSS friendly adapter classes. This is what it looks like has happened in your case. I have no idea why
the framework is only detecting the clash when you use your global.asax or the browser file... still, I'm guessing that you have such a clash.
Also, be careful if you've compiled your whole site into a single DLL (like DICOM2.dll, if that really is a DLL for your whole site) to remove whatever code you might have in App_Code since it will probably still get found by the framework and compiled
into temp DLLs which will definitely clash with your prebuilt DLL (like DICOM2.dll).
Clear as mud?
Oct 19, 2006 03:28 AM|Evarest|LINK
Thank you for your reply! I didn't know it wasn't normal behaviour of VS to create a DLL of the entire website... Is there any way I can _not_ create this DLL and that way avoid all my troubles?
Oct 19, 2006 05:43 AM|Evarest|LINK
Oct 19, 2006 11:03 AMemail@example.com|LINK
Have you tried clearing out the contents of the Temporary ASP.NET build folders?
Simply close Visual Studio (all instances), browse to the directory mentioned, and delete all contents.
You can then retry building the project...
Oct 20, 2006 07:48 AM|Evarest|LINK
I tried deleting these temporary files, but without any success... I did manage to get the site up and running on a demoserver (after publishing it). However, of course, i cannot debug it without the actual CS files...
For now i've removed the .browser file from the project.
Oct 20, 2006 11:47 AM|Russ Helfand|LINK
If you can afford the time to investigate this further....
Please open your web site in Visual Studio. That's where you said you were having trouble running the site from. Make sure that the "solution explorer" panel visible. Right click on your solution in the solution explorer (the topmost node in the tree).
Choose "property pages". Take a look at the preferences for "msbuild" and "build". You may discover that you are purposely pre-building your web site (rather than letting the framework build it on-the-fly in the temp area). You may also discover that your
pre-build web site is being explicitly put into your site's bin folder... that is how it is getting there, that's my guess.
Try setting the preferences so you do NOT build the web site from Visual Studio. Remove the dll from the bin folder. And try running from VS again. Please let me know what happens.