Crosslight async await

5 replies. Last post: May 5, 2015 8:21 AM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hello Crosslight Support,

I started a new project with the "Drawer Template" (VS Crosslight Project Wizard). Then I wanted to extend this project to make use of async/await. So, I added references to the following assemblies in the core project: System.Threading.Tasks, System.Runtime, Microsoft.Threading.Tasks, Microsoft.Threading.Tasks.Extensions.

In the same project I wanted to make use of the Crosslight ResourceLoaderService. So I added the assemblies Intersoft.AppFramework and Intersoft.Crosslight.Service.ImageLoader to the core project.

I thought that's it, but when compiling the project I get several errors:

- await not recognized

- ResourceLoaderService not recognized(ServiceProvider.AddService<IResourceLoaderService, ResourceLoaderService>();)

I checked the behaviour with the Business Template. Here it compiles without an error. After comparing the project files, I found the difference and added the following lines at the end of my project file:

<Import Project="..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets')" />

<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">

<Error Condition="!Exists('..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />

<Error Condition="Exists('..\packages\Microsoft.Bcl.Build.1.0.13\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />

</Target>

After that I can compile without an error. Why?

I just set references to the assemblies. Is it better to add the assemblies via NuGet?

Some clarification would be nice.

Could you also describe the requirements and dependencies for using async/await.

Could you additionally describe the requirements and dependencies for using ResourceLoaderService.

I think here is a great gap in the documentation. The only chance is analyzing the samples.

Thanks,

Thomas

All times are GMT -5. The time now is 9:37 PM.
Previous Next