Last post Oct 12, 2016 07:17 AM by madog
Oct 07, 2016 01:23 AM|Madog|LINK
I built a web api controller that handles file operations requested by the client.
I initially created two classes in the same file under the namespace GNC_Corp.FileUpload. (GNC_Corp is the project name and root namespace)
The two classes were FileUploadController and FileOperations.
I then decided to extract the FileOperations class into a separate file under the App_Code directory.
This all compiled successfully ( I had to set the 'Build Action' to 'compile' for it to recognise the
When I go into Class View, it now shows GNC_Corp in two separate sections, each with a
FileUpload namespace and a FileOperations class.
One of them also has the FileUploadController class.
I do not understand why I have two GNC_Corp sections, each with a FileUpload namespace and a
Oct 10, 2016 02:48 PM|Chris Zhao|LINK
App_Code folder is a special ASP.NET RUNTIME folder. Any files in this folder are compiled by ASP.NET when your site is actually running on the server. ASP.NET is trying to compile your App_Code folder (as it is a special Runtime folder and that is an expected
behavior) which will result in duplicate declaration of your class (one in the referenced project DLL and second in the dynamic compilation). As you can imagine duplicate declaration of same type is not desirable.
Oct 12, 2016 07:17 AM|Madog|LINK