Profile Picture

References - Build 36 v. 39

Posted By alpha23 5 Years Ago
Message
Posted Thursday February 02 2012
I’m attempting to upgrade my code from build 36 to build 39 but it appears that references are handled differently. In 36, I was able to reference libraries outside of the RightEdge 2010 folders. This allowed me to change code, rebuild via Visual Studio, and execute the system without restarting RE. In 39, with the same references config, I receive a File.IO exception. The fix was to copy the same reference libraries to the “RightEdge 2010\Plugins” folder which is straightforward; however, RE now loads these reference libraries upon startup and locks them. That is, every time a code change/rebuild via VS is needed of the reference libraries, I need to restart RE.

Please advise because the method in 39, as described above, is extremely laborious.

Thanks, Duane
Posted Friday February 03 2012
Hi Dwebber,

I don't think we've changed anything about how the system is loaded since build 36. If the references you need are in the same folder as your system DLL, then they should be loaded successfully. Anything that you put in the Plugins folder will be locked while RightEdge is running.

Visual Studio normally puts built DLLs into a subfolder such as bin/debug. RightEdge, however, just loads the DLL from the same folder as the .rep file is in. Is it possible that the references weren't being copied to the correct folder?

Thanks,
Daniel
Posted Saturday February 04 2012
Daniel,

I receive the following exception in 39 when I reference an assembly that is not in the plugins dir. The same exception is not thrown in 36.

An exception of type System.IO.FileNotFoundException was thrown.
Could not load file or assembly 'ResponseLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at RightEdge.Shared.SystemWrapper.LoadFrom(String AssemblyFilename, String systemClassName)
at RightEdge.Shared.SystemWrapper.Initialize(Control syncControl, AppDomain mainDomain, ICallbacks callbacks, String systemFileName, String systemClassName, String userAppDataPath)
at RightEdge.Shared.TradingModuleWrapper.LoadPlugin()
at RightEdge.Shared.TradingModuleWrapper.Run(String filename)
at RightEdge.Shared.TradingModuleWrapper.RunSystem(SharedSystemRunData systemRunData)
at RightEdge.SystemProgress.InitAndRunSystem()

Why am I receiving this?

Thanks, Duane
Posted Monday February 06 2012
Try modifying the system so that it doesn't need the reference (comment stuff out), and add the following line to your Startup method:

OutputMessage("Code base: " + typeof(MySymbolScript).Assembly.CodeBase);

This will tell you where the system assembly is being loaded from. Make sure that the reference is in the same directory.

You can also use Fusion Log Viewer to get more information about why it is failing to load the assembly.

Thanks,
Daniel
Posted Wednesday February 08 2012
Daniel,

   I can’t remove the reference because my system(s) are dependent on it. The system does not build so it never enters Startup. Also, I ran Fusion Log Viewer but nothing is appearing (set “log all binds to disk”, default log location, default log categories). I also checked the rep file reference paths. All paths are referenced correctly in the rep.

Please advise.

Thanks, Duane
Posted Monday February 13 2012
please advise.

Thanks, Duane
Posted Tuesday February 14 2012
Try the "Log in exception text" option in fusion log viewer. If it works correctly, you should see a bunch more debug information in the FileNotFoundException that is thrown. If you don't, try forcing RightEdge to run under .NET 4 as described here and see if that helps.

As far as logging in your system startup, I was suggesting that you basically disable all the logic in your system by commenting out anything that needs the library. However, it's probably simpler just to copy the required reference to the plugins folder so it does build and run, and then add the code to log the assembly CodeBase.

Thanks,
Daniel
Posted Tuesday February 14 2012
Daniel,

Thanks for your help on this. I was able to resolve the issue with your suggestions.

Duane
Posted Wednesday February 15 2012
Daniel,

   I was mistaken. The issue is not resolve. I had accidently left copies of the relevant dll, there are actual 2, in the Plugins folder which is why it ran. Which leaves me with the same problem.

As for .Net 4.0, I had already added the required xml lines to the config file. It is definitely not a 4.0 issue. For the assembly binding log viewer, nothing is showing up after multiple attempts (Note, RE only gets to step 1 of 3). I once again rechecked the paths in the rep file and all paths point to actual dlls. As for removing the logic attached to the dll, I’ve already placed breakpoints in startup - it is hit before any logic from the dll is called – and the breakpoint is never hit.

Regarding moving the dll into the plugins directory, this is what I need to avoid so I can rebuild in VS, then rerun the system without restarting RE.

In build 36 I’m not required to have the dlls in the plugins folder. The only way that it works in 39 is i) shut down RE, ii) copy the same dlls referenced in the rep file to the plugins dir, and iii) restart RE.

Note, I added a separate post http://www.rightedgesystems.com/forums/Topic14038-13-1.aspx. I'm not sure if this is related.

Can you please recheck and advise?

Thanks, Duane

Edited: Wednesday February 15 2012 by alpha23
Posted Thursday February 16 2012
I set up a simple system that references and uses a separate library. I'm able to run the system, modify both the system and library, rebuild, and run the system again without restarting RightEdge. Can you try the system (which I've attached) and see if you can do the same?

Thanks,
Daniel


Attachments
ReferenceTest.zip (178 views, 24.00 KB)


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems