Details
-
Type: Bug
-
Status: Resolved
-
Priority: Critical
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: PicoContainer.NET
-
Labels:None
-
Environment:Windows XP
-
Number of attachments :
Description
AddAssembliesFromWorkingDirectory uses Directory.GetCurrentDirectory(). For a web application, that's the current directory of the server process which is */System32 folder not the application path of the web app. Things get worse, the function assumes anything with a *.dll is a managed assembly and is added to the compiler parameters.
In its current state, NanoContainer.NET cannot be used for web applications. It would also probably cause undetectable issues if the CurrentDirectory() was somehow changed while a non web-application is running.
To reproduce:
Create a web application and break any where. Type in the command window ?Directory.GetCurrentDirecory() to see */System32 as folder.
Activity
Michael Ward
made changes -
Field | Original Value | New Value |
---|---|---|
Assignee | Michael Ward [ mward ] |
Michael Ward
made changes -
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Resolved [ 5 ] |
No longer searching current working directory for *.dll files. PicoContainer.dll and NanoContainer.dll are now the only assemblies referenced "magically" by default.
Assemblies that need to be referenced for use in the script must be named and passed in the assemblies parameter see example ...
StringCollection assemblies= new StringCollection();
sc.Add("NanoContaer.Tests.dll ");
builder.BuildContainer(simpleReference, parentReference, assemblies);