Page 1 of 2
Problem referencing assemblies outside GAC
Posted:
Fri Jan 08, 2010 1:03 pm
by RIGHT_THEN
GentleMen,
Pardon me if i am worng but i just could not find any IDE of cobra
i read Cobradevelop but i cannot locate any files to download.
so i decided to try my hand at developing a plugin of Cobra For
Sharpdevelop.
for last two days i am developing SharpDevelop Plugin For Cobra
Every Thing seems to go well untill i have to reference assemblies
outside of gac. how does one do that i used the -ref: option but to no avail
2) how does one tell cobra compiler to output files to a particular folder
i used -output: option but only .exe or .dll file is produced there Intermediary
Files are created in the Folder the Source Files are present in .
althou i have never used cobra for anything but it sounded interesting
and i am starting it by making a plugin for it in Sharpdevelop
and i have never done that before either but never the less i am able to do these thing succesfully by now
Plugin does these things
1) Successfuly Creates Console , Winform And ClassLibrary Projects/Solution
It can Create new ones and open the allready existing ones
2) Syntax Highlighting is Also available as the file for it was allready created
by gogobyte
3)Few FileTypes templates are also created and they work
4)it is also compiling Console , Winform and ClassLibrary Projects
althou CodeCompletion or autocompletion is not implemented yet because
i dont know anything about parsing and Asts that need to be created for that
and going through the code of cobra would i be write in assuming that
only regular expression are being used to parse Cobra files!!!?
now to the original problem again if a project loads libraries from GAC
then project compiles well but if a assembly is loaded from outside the Gac
it gives error cannot find the Assembly . i tried giving the path from -lib: but to no avail .
if the assembly path is presented like this ../../../Folders/Folders then would the compiler have some problems picking that up
i think i will only ask this much yet
Awaiting your responses
Thankyou
RIGHT_THEN
Re: Problem referencing assemblies outside GAC
Posted:
Sun Jan 10, 2010 1:29 am
by Charles
Awesome!
-- You are correct that there is no IDE support right now with autocompletion, debugging, etc. There are syntax highlighting files and some other bits for editors and some IDEs like CodeLite (which is not .NET aware).
-- Please be sure to use Cobra out of
source.
-- The Cobra tokenizer uses regexes, but not exclusively.
-- Note that you can build a Cobra.Lang.Compiler.dll which then enables you to use the compiler classes as a library. So you could instantiate the compiler, or the parser, etc. Invoke "comp-compiler-dll" at the command line to do so, from the cobra\Source\ directory.
-- I'm able to reference local DLLs with -ref although they are always in the same directory. I know gauthier references many DLLs in other directories in his projects. Do you have a particular small test case that reliably fails that you can share?
Re: Problem referencing assemblies outside GAC
Posted:
Sun Jan 10, 2010 2:38 am
by RIGHT_THEN
Dear Mr. Chuck
Thankyou so much for the reply
this is the first time in my life i am corresponding
with an author and that to of a programming language.
i am so happy for that and may GOD bless you and bring all the happiness and peace to you .
if you want something else you can always pass extra arguments.
i think the syntax is -- arg1 arg2 arg3
A little correction thou ( he better keep the share of the same for me too )
as for the problem
i am able to refrence assemblies from other directories now
both with exe extension as well as dll extension. i had to hack some information
produced by MSBUILD and make it appropiate for COBRA.
Problem was mainly because of the fact that how to convey strings to COBRA compiler
that we would otherwise write on command prompt without much trouble, without getting
into the detail of it , it has been fixed.
this primitive plugin , how can i make it available to the COBRA community
i mean how to post it where and how? because i have never used internet before
for uploding anything i have only downloaded content , read mails and browsed sites..
as of debugging when i put breakpoint and run programm . breakpoints are recognised
by the debugger and i can step through the programm as it flows. but for what is inside
the symbols and variables for some it show the detail and for some it does not.
but even with this much i find this plugin very handy.
i am very eager to make it available to you so that you can use it and see what i am saying
but how do i do that please tell me that
i have many more questions to ask...
ThankYou
RIGHT_THEN
Re: Problem referencing assemblies outside GAC
Posted:
Sun Jan 10, 2010 2:54 am
by gauthier
Just about reference paths:
I'm using nant as builder, but all arguments / references are passed as absolute path to cobra compiler so I may not have encounter this behaviour.
Re: Problem referencing assemblies outside GAC
Posted:
Sun Jan 10, 2010 9:46 am
by Charles
Thanks.
Since Cobra is producing .NET byte code then debuggers will automatically work to a great extent.
It looks you might have already picked CodePlex for hosting which is fine:
http://cobrapluginsd.codeplex.com/What is the "d" for in "cobrapluginsd"?
We also have some projects on bitbucket.org as you can see at
RelatedProjects.
There is also a thread here with some repo links at
"SharpDevelop 3.0 is out".
Once you know for sure where you are hosting then please add a link to the wiki under that page as well as
IDESupport. Feel free to use any of the free public hosting sites like CodePlex, Google and BitBucket.
Re: Problem referencing assemblies outside GAC
Posted:
Mon Jan 11, 2010 12:14 am
by RIGHT_THEN
@chuck
what is 'd' is cobrapluginsd ?
it is like COBRA PLUGIN SHARPDEVELOP
Thankyou
RIGHT_THEN
Re: Problem referencing assemblies outside GAC
Posted:
Wed May 09, 2012 8:51 pm
by torial
I know this is old -- but I'm running into the same issue.
If I run this batch:
- Code: Select all
C:\Cobra\bin\cobra.bat -c -turbo -t:lib -out:Naja.Plugin.CobraFolding.dll CodeFolding.cobra -ref:mscorlib.dll -ref:System.dll -ref:ICSharpCode.TextEditor.dll -ref:Cobra.Lang.dll
It works fine.
If I add a reference to a "NajaCommon.dll" like so:
- Code: Select all
C:\Cobra\bin\cobra.bat -c -turbo -t:lib -out:Naja.Plugin.CobraFolding.dll CodeFolding.cobra -ref:mscorlib.dll -ref:System.dll -ref:ICSharpCode.TextEditor.dll -ref:Cobra.Lang.dll -ref:NajaCommon.dll
I get:
Cannot locate assembly reference "NajaCommon.dll"
The directory contents of the folder where I run this command are:
Cobra.Lang.Compiler.pdb
ICSharpCode.TextEditor.dll
ICSharpCode.TextEditor.pdb
CobraFoldingStrategy.bat
CodeFolding.cobra
NajaCommon.dll
NajaCommon.pdb
Cobra.Lang.Compiler.dll
Re: Problem referencing assemblies outside GAC
Posted:
Wed May 09, 2012 11:27 pm
by Charles
I don't see any problem off the top of my head. Can you pack up the directory as a .zip and put it somewhere for me to download?
Re: Problem referencing assemblies outside GAC
Posted:
Thu May 10, 2012 9:47 am
by Charles
Torial passed me the files and I checked it out.
I found an option in Cobra I had forgotten about. Compiling with -verbosity-ref:1 I get:
...
>> .loadReference("NajaCommon.dll")
: "NajaCommon.dll" found as file. Will Assembly.loadFrom().
: Assembly.loadFrom() returned: NajaCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null (Assembly)
: Will read assembly: NajaCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
: Reading assembly: NajaCommon, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Caught exception during read assembly: System.IO.FileNotFoundException: Could not load file or assembly 'Qios.DevSuite.Components, Version=4.0.0.20, Culture=neutral, PublicKeyToken=3cc53827b79c92fa' or one of its dependencies. The system cannot find the file specified.
: File name: 'Qios.DevSuite.Components, Version=4.0.0.20, Culture=neutral, PublicKeyToken=3cc53827b79c92fa'
: at System.Reflection.Assembly._GetExportedTypes()
: at System.Reflection.Assembly.GetExportedTypes()
: at Compiler.__dotNetReadAssembly(Assembly ass, Boolean skipCobra)
: at Compiler.__dotNetLoadReference(String reference)
...
So it was a missing reference.
Obviously, Cobra should be outputting this information without having to pass any additional flags. I'll fix that. In the mean time, you can use that option when you need to.
Re: Problem referencing assemblies outside GAC
Posted:
Thu May 10, 2012 10:05 am
by torial
Thank you! Good to have the mystery solved.