I am developing a web application in Visual Studio 2010 with a target structure of 3.5 I am using a dll (developed by another team) in which I get an error message for the following code:
string strName = System.Reflection.Assembly.GetEntryAssembly().GetName().Name;
i checked and found that System.Reflection.Assembly.GetEntryAssembly () returned null, also searched about it and found in msdn that GetEntryAssembly () could return null when it was called from any unmanaged code.
When I call from my web application, it returns null, and when I call from any Windows application, it works fine, i.e. it gets the name of the record assembly (the assembly from which the execution was started). Why does it return null in a web application? I do not understand. I also tried changing the output type of my web project to Class Library, from the project properties in visual studio, but the drop-down list for the output type is disabled and I cannot change the output type of the project. Please help me if any solutions exist for this problem.
early
Amit Shahani
source share