Home Dashboard Directory Help
Search

'System.TypeLoadException' when using Async for WP7.5 version 1.0.11-beta by Sgt-Riggs


Status: 

Closed
 as Fixed Help for as Fixed


5
1
Sign in
to vote
Type: Bug
ID: 768521
Opened: 10/24/2012 2:45:15 AM
Access Restriction: Public
1
Workaround(s)
view
5
User(s) can reproduce this bug

Description

When using 'Microsoft.Bcl.Async' version 1.0.11-beta in Windows Phone 7.5 project, the app crashes when it gets to Task-based awaitable code with the following exception:

"An unhandled exception of type 'System.TypeLoadException' occurred in *.dll.
Additional information: File or assembly name 'System.Threading.Tasks, Version=1.5.10.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A', or one of its dependencies, was not found."

The build output contains the following lines (they repeat two times for two projects that use 'Microsoft.Bcl.Async'):

> Consider app.config remapping of assembly "System.Threading.Tasks, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.10.0" [] to Version "1.5.11.0" [...\packages\Microsoft.Bcl.1.0.11-beta\lib\sl4-windowsphone71\System.Threading.Tasks.dll] to solve conflict and get rid of warning.
> Consider app.config remapping of assembly "System.Runtime, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "1.5.10.0" [] to Version "1.5.11.0" [...\packages\Microsoft.Bcl.1.0.11-beta\lib\sl4-windowsphone71\System.Runtime.dll] to solve conflict and get rid of warning.

Since it's a Windows Phone project, I can't use app.config to resolve this issue like it's described in 'Known Issues' document for 'Microsoft.Bcl'.
Details
Sign in to post a comment.
Posted by ngmO11 on 1/24/2013 at 3:28 PM
ConfigureAwait(false) doesn't seems to ignore the captured context.

The same code works in .NET v4.5 but with this library it doesn't.

- ngm
Posted by ThumbGen on 1/16/2013 at 5:05 AM
I get the same error... please fix it!
Posted by ngmO11 on 11/5/2012 at 1:06 PM
Immo,

I still see reference to System.Threading.Tasks.dll v1.5.11.0 in Microsoft.Threading.Tasks.dll v1.0.12.0:

.assembly extern System.Threading.Tasks
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 1:5:11:0
}

I'm getting following Exception:

Type=System.IO.FileLoadException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message=Could not load file or assembly 'System.Threading.Tasks, Version=1.5.11.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)

I have only System.Threading.Tasks.dll v2.5.11.0 in my bin.

Thanks,

- ngm
Posted by rajenkishna on 10/26/2012 at 6:37 AM
Ignore my comment, it's fixed.
Posted by rajenkishna on 10/26/2012 at 6:07 AM
The exception still occurs on version 1.0.12.
Posted by Microsoft on 10/25/2012 at 5:31 PM
Thanks again for reporting the issue. This was indeed a bug in our build that caused an incorrect version in the assembly references. We've uploaded a new NuGet package. The new version is 1.0.12 and is available here:

https://nuget.org/packages/Microsoft.Bcl.Async/1.0.12-beta

All the best,
Immo Landwerth
Program Manager, .NET Framework Team
Posted by Sgt-Riggs on 10/25/2012 at 4:11 AM
Great, waiting for the update. The release of WP8 SDK is few days aways, as I understand, so it would be great if such obvious issues are fixed.
Posted by Microsoft on 10/24/2012 at 7:48 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Microsoft Visual Studio Connect Support Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 10/24/2012 at 4:40 PM
Thanks for reporting the issue. After looking at the assembly references it seems to be an issue with our build having been compiled against the wrong version of the Microsoft.Bcl NuGet package.

We'll update the Microsoft.Bcl.Async package accordingly.
Posted by Microsoft on 10/24/2012 at 2:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by ngmO11 on 1/24/2013 at 3:26 PM
Remapping of System.Runtime and System.Threading.Tasks to v2.5.11.0 versions solves the problem:

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
     <dependentAssembly>
        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.5.11.0" newVersion="2.5.11.0" />
     </dependentAssembly>
     <dependentAssembly>
        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.5.11.0" newVersion="2.5.11.0" />
     </dependentAssembly>
    </assemblyBinding>
</runtime>

- ngm