Travails of an ungeeker

Monday, February 06, 2006

Compiler Error Message: CS1595 - LoadControl() issue when debug set to false

A Google on this error returns two possibilities on microsoft.com (at time of writing). Neither documented solution applied here. However I remembered recently setting the web.config debug=false instead of true, which had triggered the error. I didn't have time to fully look into the problem, but it complained about a user control having two definitions, which really was true! The was being loaded dynamically with LoadControl() but there was still a static reference. I haven't thought through why it would have worked ok in debug mode. Anyone know? Perhaps the added debug hooks mask the error.

There could also be a bug somewhere in Visual Studio because the offending line was in the user control which in turn contained a script tag (client-side) with a src attribute. When the src attribute is commented out then the dynamic load of the user control caused no problems. In my case I can refactor this particular dynamic load out of the code anyway. Perhaps this points someone else similarly stuck in the right direction.

0 Comments:

Post a Comment

<< Home