dll versioning issues

Jan 26, 2015 at 3:47 PM
I am trying to use the source code, so I can add proxy support for username:password proxies.

As mentioned in the other threads, I had issues getting this to work as I had to install windows8, then use the correct version of visual studio to even get it to load in the dev studio, then when running it back on Windows 7 got an error with system.net.httpclient not able to set proxy.

Anyway, that fix was to add nuget packages
microsoft.bcl
system.net.http

That got the program to run, and it runs on my machine fine. However, when I move the program to the production machine it errors with:
Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference
As the source code is portable it is targeting windows8, .net4.0 (I have removed the other options), I cannot remove windows8 support without creating a new project. This will give a latest version of
System.Net.Http.Primitives v 2.28 or something similar

Then I add the tweetinvi dlls to my project, but now when I build, due to adding system.net.http to fix a previous issue, I get the latest versions as I am targeting only windows 7 / .net 4.0 this it brings down the version 4.02 or something

Thus when trying to run, get the dll versioning issue.


Any ideas on how to get this to work would be greatly appreciated.

Or even confirmation it is possible to get working on windows7
Jan 28, 2015 at 1:25 AM
So the fix was.

Remove all existings projects,
Readd projects as normal .net projects (not portable)
Removes the previously mention issue with system.net versioning as don't need nuget so it doesn't bring the wrong version down depending on the machine that is targeted

Finally got the project working on the production machine, with username:password proxy support :-)
Jun 24, 2015 at 8:20 PM
Have updated to the new version and getting the same issue again, is there another known way, I don't feel like creating a new solution to remove the dll versioning issues due to it being portable.



It seems that when I add references to the tweetinvi project and add the relevant nuget packages, as I am not building a portable app, VS2013 adds in teh latest version of the file:
System.Net.Http.Primitives.dll

4.2.29.0

But tweetinvi is expecting 1.5.0.0
: Could not load file or assembly 'System.Net.Http.Primitives, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Coordinator
Jun 24, 2015 at 9:20 PM
Hi,

Why don't you simply use nuget to get the library? Nuget will automatically get the libraries with the good version.
I am creating multiple new projects with Visual Studio 2013 every week and I do not have this kind of issue.

If you do not want to add the packages, you could simply retrieve the libraries from nuget and then adding them manually?

Cheers,
Linvi

PS : Sorry for not replying in january. I was not very responsive in this period.
Jun 24, 2015 at 9:38 PM
I need to make a few changes in order to do what I need to do.

Not sure if it is part of the cause, but am using win7 (I can only open tweetinvi source in win8)

Was strange that it would work in VS, but not on production.

The fix (for me) was to include the APP_NAME.exe.config file over, which was redirecting the old system.http.primitives 1.500 to the new version I had