I deployed a solution to Azure to find that Microsoft.Threading.Tasks was missing and the application could not load.
One of my referenced projects I use the portable stuff
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="portable-net45+sl50+win+wp80" developmentDependency="true" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="portable-net45+sl50+win+wp80" developmentDependency="true" />
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="portable-net45+sl50+win+wp80" developmentDependency="true" />
<package id="Microsoft.Net.Http" version="2.2.22" targetFramework="portable-net45+sl50+win+wp80" developmentDependency="true" />
<package id="Newtonsoft.Json" version="6.0.3" targetFramework="portable-net45+sl50+win+wp80" />
</packages>
and I marked those as developmentDependency such my main project don't include these portables. I was under the impression that a .NET 4.5 application would not need the portable packages as they already should be in the core of .NET and the BCL stuff was only needed at build time.
Is my assumption wrong? Should I still include Microsoft.Bcl.Build and Microsoft.Bcl.Async in my .NET 4.5 applications?
The issue is your library was compiled to talk to "something" inside Microsoft.Threading.Tasks (and actually you will likely need to include Microsoft.Threading.Tasks, Microsoft.Threading.Tasks.Extensions, and Microsoft.Threading.Tasks.Extensions.Desktop in your deployment). If you are on .NET 4.5 the code in those 3 DLLs know just to forward the call on to the NET framework, if you are on .NET 4.0 it does its replacement calls.
Your compiled DLL's "Imports" (to use a C term) does not change depending on its runtime environment. Your program always has to make a call in to that proxy, the proxy may do very little on a 4.5 system, but the call still has to happen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With