问题
I have Windows Phone Silverlight 8.1 application which is using BackgroundTask project for WNS and timer tasks. I`m getting following error on calling some method from BackgroundTask project:
ERROR: Native images generated against multiple versions of assembly System.Net.Http.
Does anyone have some idea where can be problem?
回答1:
I found a problem:
I have Windows Phone Silverlight 8.1 main project (converted from WP8 for IBackgroundTask support) referenced to DAL project (WP Silverlight 8.1). Also I have a background task project (WP8.1) referenced to DAL project (WP 8.1). Both DAL projects (linking classes) are using System.Http classes.
Error occurs when main WP Silverlight 8.1 project calls method of background task WP8.1 which is using some features of DAL WP8.1 project. At this moment environment loads DAL WP8.1 dll with reference to different version of System.Http library.
Solution: I moved functionality from background task project to DAL project and do not call methods of background task project in main WP Silverlight 8.1 application.
来源:https://stackoverflow.com/questions/24305952/native-images-generated-against-multiple-versions-of-assembly-system-net-http