[Mono-list] Choosing library to compile against

Francisco Figueiredo Jr. francisco at npgsql.org
Thu Feb 21 19:00:24 UTC 2013


On Thu, Feb 21, 2013 at 3:17 PM, Peter Hultqvist <phq at silentorbit.com>wrote:

>  I was using MonoDevelop to set up the project(3.1.0 from git repo)
> But the result is the same if built from MonoDevelop or using xbuild.
>
> I made the test program that reproduce the error.
> https://github.com/hultqvist/issueTestReferences
> The TestReference.sln is made using monodevelop from git, for some reason
> that solution file did not work with monodevelop from ubuntu 12.10 so I
> made a second solution from scratch using that version of monodevelop,
> TestReference2.sln.
> Same result in both.
>
>
Hmmmmm, I'll give it a try when I get at home. I don't have access to
monodevelop right now.


>
> > The way to force the compiling is to add the reference. It should work.
> I'm not following here, I must add references for the project to compile
> at all its not an option not to.
>
>
Oh, sorry for that. This was actually a response to your question: "Is
there any way to force the compiling process to use the version in the
solution instead of the one from the gac?"
But I didn't add a proper context to it.



>  I see it's your project I'm using  but I don't think that is where the
> problem lies.
>
> From what I can see the TestLib is correctly compiled against the local
> version of Npgsql but when TestReferences is compiled(with Npgsql and
> TestLib) then the npgsql references in TestLib points to the gac while the
> TestReferences point to the local version and thus the error message.
>
>
>
The projects I worked with only had a direct dependency to Npgsql2. I never
played with a project which had an indirect dependency.

Are you able to change the TestLib project properties when it is open
inside TestReferences?


Did you try add a reference to a fixed path to Npgsql2 assembly to both
TestLib and TestReferences projects instead of pointing them to the Npgsql2
project? Or maybe just change TestLib reference to a fixed path to Npgsql2
assembly?

I hope it helps.



> On 2013-02-21 17:51, Francisco Figueiredo Jr. wrote:
>
>
> Are you using Monodevelop?
>
>  Did you try to compile a simple test program from command line to see if
> it works ok?
>
>  The way to force the compiling is to add the reference. It should work.
>
>  Try to create another simpler project and test if you can compile it.
> Maybe there is some problem in the project file which isn't updating your
> references?
>
>
>
> On Thu, Feb 21, 2013 at 10:46 AM, Peter Hultqvist <phq at silentorbit.com>wrote:
>
>> How can I force a project to compile using a specific project rather
>> than looking in the gac?
>>
>> My application is using the Npgsql but because of a bug in the
>> distribution release I downloaded and compiled the source for it. It is
>> included in my solution as a project along my other code.
>> My projects is referencing the npgsql project in the same solution.
>>
>> The distribution(Ubuntu 12.10) version pulled from the
>> mono-complete/mono-dev packages.
>>
>> The big problem is that I get compile errors such as
>>
>> error CS1502: The best overloaded method match for
>> `....Prepare(Npgsql.NpgsqlCommand)' has some invalid arguments
>> error CS1503: Argument `#1' cannot convert `Npgsql.NpgsqlCommand'
>> expression to type `Npgsql.NpgsqlCommand'
>>
>> Some details: My solution has the npgsql project and two projects of my
>> own, A and B, both referencing the npgsql project. Prepare is defined in
>> project A and used in project B. Project A compiles fine and project B
>> is the one with the error above.
>>
>> Is there any way to force the compiling process to use the version in
>> the solution instead of the one from the gac?
>> I thought I had already done that when I reference the solution project
>> rather than the package, is it perhaps a bug?
>>
>> Same error comes up when compiling using xbuild.
>>
>> The only workaround now is to remove the npgsql files from /usr/lib/mono
>> but that is something I rather not have to remember for every new install.
>> _______________________________________________
>> Mono-list maillist  -  Mono-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>
>
>
>  --
> Regards,
>
> Francisco Figueiredo Jr.
> Npgsql Lead Developer
> http://www.npgsql.org
> http://gplus.to/franciscojunior
> http://fxjr.blogspot.com
> http://twitter.com/franciscojunior
>
>
>


-- 
Regards,

Francisco Figueiredo Jr.
Npgsql Lead Developer
http://www.npgsql.org
http://gplus.to/franciscojunior
http://fxjr.blogspot.com
http://twitter.com/franciscojunior
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20130221/e5e9d8af/attachment-0001.html>


More information about the Mono-list mailing list