I am unfamiliar with the way ASP.NET (using MVC) deals with .dll
files and would like to know why the following behavior occurs:
In both scenarios, there is a primary MVC application and a secondary MVC application (MyApps.Secondary
). And in both instances, the secondary application has hard coded view locations in the actions.
Scenario One
When I move the .dll
of the secondary application to my primary MVC application's bin
folder I can navigate to the controllers in the secondary application.
Scenario Two
If I move the .dll
of the secondary application to a different folder (called extras
) under my primary web application, I then have to do the following in order to easily navigate to one of the actions/controllers inside the secondary application via the primary web application:
1- Add MyApps.Secondary
under the assemblies section of the compilation section
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="MyApps.Secondary"/>
2- Add the folder extras
(the folder where MyApps.Secondary
is located` in the probing element
<probing privatePath="bin;extras"/>
I guess my question is, why do both of these scenarios work and why do I need to do the extra work in scenario two?
An answer to this question about the compilation element states that <compilation><assemblies>
element is meant for compiling .cs
and .vb
files, but in both my scenarios, I don't have either type of files. Is it maybe used for compiling .aspx/.ascx
pages for the secondary application? If it is indeed compiling .aspx/.ascx
files, why do I not need to include the assembly in the first scenario?