Using C# dll (built with Microsoft.bcl) in interop(C++ managed) project -


we've c# dll in .net4.0 built using using microsoft.bcl, microsoft.bcl.async, microsoft.bcl.build, microsoft.net.http. these libs got nuget. we've reasons not move .net4.5 want use async, await these bcl libs. works fine in c# projects, couldnt add dll in our c++ interop projects, error:

we error when try add reference project.

even though clr interop project in .net4.0 , dll adding in .net4.0 end getting error. there way resolve this?

error in text format: --------------------------- microsoft visual studio --------------------------- not add reference to:  c:\xxx\xxx\xx\xxxhelper.dll    1 of following reasons:      - targets higher version of .net framework      - not .net assembly      - not registered activex control --------------------------- ok    --------------------------- 

code reproduce issue: https://dl.dropboxusercontent.com/u/1967630/bcl_problem/oauth2_sdk_consumer_dll/bcl_problem_projects.zipx

i repro, sure looks bug. judging error message in screenshot using vs2013. unhelpful message, got toned down in vs2015 still fails. odd bug btw, seems treats microsoft.threading.task assembly reference c# project uses framework assembly. no prior questions issue know of, programmers right without having fight machine.

you should consider doing way avoid error. goes wrong if use browse button in add reference dialog. works fine when use project reference, way programmers prefer configure solution. use file > add > existing project, select c# project. add reference again time select c# project solution > projects list instead of using browse button.

if undesirable reason can work around way. open .vcxproj in text editor, notepad fine. locate element:

   <targetframeworkversion>v4.0</targetframeworkversion> 

and modify version number v4.5. add reference did before browse button, no complaints time. , go notepad , change version number v4.0


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -