Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referencing external components will throw notfoundexception #34

Closed
orchardbot opened this issue Jan 8, 2010 · 5 comments
Closed

Referencing external components will throw notfoundexception #34

orchardbot opened this issue Jan 8, 2010 · 5 comments
Assignees
Labels
Milestone

Comments

@orchardbot
Copy link

@Jetski5822 created:
https://orchard.codeplex.com/workitem/15781

Problem -
Adding a reference to a component in a project that is outside the scope of the project and not in the GAC will cause a notfound exception becuase it is not referenced within the Orchard.Web project.

How to reproduce -

  1. Create A new project
  2. Reference a component that is outside the scope of the project and not in the GAC
  3. Create a .cs file in the newly created project, and put a using statement to the component in the .cs file.
  4. run - You should see the bing error message below

Solution -

  1. You could add the reference in to the Orchard.Web Project
    or
  2. change the way BuildManager.GetReferencedAssemblies() works by going down the tree - A good article http://msdn.microsoft.com/en-us/magazine/cc163641.aspx
    I am part way to a solution for this, so once finished i will patch up.

Big Error ---

Server Error in '/' Application.
Could not load file or assembly 'file:///C:\Users\mayn2\AppData\Local\Temp\vsu96r7w.dll' or one of its dependencies. The system cannot find the file specified.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Users\mayn2\AppData\Local\Temp\vsu96r7w.dll' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 39: {
Line 40:
Line 41: throw;
Line 42: }
Line 43: }

Source File: D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Extensions\Loaders\DynamicExtensionLoader.cs Line: 41

Assembly Load Trace: The following information can be helpful to determine why the assembly 'file:///C:\Users\mayn2\AppData\Local\Temp\vsu96r7w.dll' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value HKLM\Software\Microsoft\Fusion!EnableLog to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

[FileNotFoundException: Could not load file or assembly 'file:///C:\Users\mayn2\AppData\Local\Temp\vsu96r7w.dll' or one of its dependencies. The system cannot find the file specified.]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity) +26
System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly() +85
Orchard.Extensions.Loaders.DynamicExtensionLoader.Load(ExtensionDescriptor descriptor) in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Extensions\Loaders\DynamicExtensionLoader.cs:41
Orchard.Extensions.ExtensionManager.BuildEntry(ExtensionDescriptor descriptor) in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Extensions\ExtensionManager.cs:143
Orchard.Extensions.d__9.MoveNext() in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Extensions\ExtensionManager.cs:136
System.Collections.Generic.List1..ctor(IEnumerable1 collection) +7667732
System.Linq.Enumerable.ToList(IEnumerable`1 source) +61
Orchard.Extensions.ExtensionManager.ActiveExtensions() in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Extensions\ExtensionManager.cs:67
Orchard.Environment.DefaultCompositionStrategy.GetModuleTypes() in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Environment\DefaultCompositionStrategy.cs:27
Orchard.Environment.DefaultOrchardHost.CreateShellContainer() in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Environment\DefaultOrchardHost.cs:62
Orchard.Environment.DefaultOrchardHost.CreateShell() in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Environment\DefaultOrchardHost.cs:54
Orchard.Environment.DefaultOrchardHost.Initialize() in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Environment\DefaultOrchardHost.cs:39
Orchard.Environment.DefaultOrchardHost.Orchard.Environment.IOrchardHost.Initialize() in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard\Environment\DefaultOrchardHost.cs:111
Orchard.Web.MvcApplication.Application_Start() in D:\InformationServices\Prototypes\CMS\orchard-44851\trunk\src\Orchard.Web\Global.asax.cs:48

Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927

@orchardbot
Copy link
Author

@Jetski5822 commented:

There is a bigger problem to this really. If you dont reference the new project in orchard.web, you cant use that project. Am i right?

@orchardbot
Copy link
Author

ErikPorter commented:

Correct, you have to reference the new project in Orchard.Web. That is the current design. It is temporary.

@orchardbot
Copy link
Author

@bradmi commented:

This will be addressed when we implement the module packaging/installation behavior.

@orchardbot
Copy link
Author

IanGrainger commented:

Sorry if I'm not helping, but using the 0.1 release, you can use a project without rerferencing it from orchard.web. If you follow the instructions here: http://geekswithblogs.net/michelotti/archive/2010/04/22/create-orchard-module-in-a-separate-project.aspx you don't need to add a reference from WebPI --> Orchard.Widget. For a while. After a while you start seeing this bug. Which you can workaround by adding a reference from Orchard.WebPI to Orchard.Widget.

It looks like there's been LOADS of fixes since the 0.1 release, I'm really anxious to try a newer version of Orchard, but when I get the default branch code out of the repository, I can't add a module by following the walkthrough. Can anyone give me any pointers on how to create a module with the later (or latest) code? That'd be super-awesome.

@orchardbot
Copy link
Author

@bleroy closed and commented:

Fixed

@orchardbot orchardbot added this to the Orchard 1.0 milestone Apr 13, 2015
@bleroy bleroy closed this as completed Apr 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants