S
Scott
Hello,
Using VS2008 in a C# web service application, a class has been created that
inherits from the ConfigurationSelection. This class file has been placed in
the App_Code folder. The web.config has been updated with the necessary
section.
Using System.Web.Configuration.WebConfiguration.GetSection(), the config
information is returned without any issues when the GetSection is set to an
object. When the object is casted explicitly to the class that inherits the
ConfigurationSelection, there is the runtime error of "Unable to cast object
of type x to x" when the application is run in debug mode.
When debugging, the types of the object returned from the GetSection is
correct.
Using reflection, the path to the assembly of the object that was returned
from the GetSection retunred the following path (using
theobject.GetType().Assembly.Location)
C:\Users\me\AppData\Local\Temp\Temporary ASP.NET
Files\root\6239671a\38ecbf2f\assembly\dl3\c7d35787\4e04a121_50bcc801\test.DLL
When a new class was created the path of the assembly was:
C:\Users\me\AppData\Local\Temp\Temporary ASP.NET
Files\root\6239671a\38ecbf2f\App_Code.zvdojd_1.dll
How do I resolve this issue?
Thanks,
Using VS2008 in a C# web service application, a class has been created that
inherits from the ConfigurationSelection. This class file has been placed in
the App_Code folder. The web.config has been updated with the necessary
section.
Using System.Web.Configuration.WebConfiguration.GetSection(), the config
information is returned without any issues when the GetSection is set to an
object. When the object is casted explicitly to the class that inherits the
ConfigurationSelection, there is the runtime error of "Unable to cast object
of type x to x" when the application is run in debug mode.
When debugging, the types of the object returned from the GetSection is
correct.
Using reflection, the path to the assembly of the object that was returned
from the GetSection retunred the following path (using
theobject.GetType().Assembly.Location)
C:\Users\me\AppData\Local\Temp\Temporary ASP.NET
Files\root\6239671a\38ecbf2f\assembly\dl3\c7d35787\4e04a121_50bcc801\test.DLL
When a new class was created the path of the assembly was:
C:\Users\me\AppData\Local\Temp\Temporary ASP.NET
Files\root\6239671a\38ecbf2f\App_Code.zvdojd_1.dll
How do I resolve this issue?
Thanks,