iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
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
The production team agrees to add a topic in Crosslight's documentation which explains how to use async and await keyword in Crosslight project. Thank you very much for your valuable feedback.
In order to enable VS 2012 (or above) project to use 'async' and 'await' keyword, we need to install (it is not the same as adding reference assembly) Microsoft Async package.
You can find, install, remove, and update packages by using the Manage NuGet Packages dialog box or by using PowerShell command-line commands in the Package Manager Console dedicated Visual Studio window. Both options are accessible from the Visual Studio main menu. You can also open the dialog box from a Solution Explorer context menu.
NuGet is the package manager for the Microsoft development platform including .NET. When you install a package, NuGet copies files to your solution and automatically makes whatever changes are needed, such as adding references and changing your app.config or web.config file. If you decide to remove the library, NuGet removes files and reverses whatever changes it made in your project so that no clutter is left.
You may notice that after install NuGet package, files like app.config; packages.config; repositories.config; etc are added into the project. NuGet is a faster better way to incorporate Microsoft Async library into your project.
Hope this helps.
Hello Yudi,
I know NuGet, it is a great tool for .NET development.
But, NuGet packages are updated from time to time. How can I know if a newer version of a package is compatible with Crosslight? Do you recommend using the latest version of a NuGet package or should I use the version shipped with Crosslight?
Another question is still unanswered. Is there a reference or some documentation about Crosslight feature and assemblies or NuGet packages one has to reference to use this feature properly? So far the samples are the only source for this.
How can I know if a newer version of a package is compatible with Crosslight? Do you recommend using the latest version of a NuGet package or should I use the version shipped with Crosslight?
The package, Microsoft Async, which shipped with Crosslight is Microsoft Async version 1.0.165. The newer version of this package is 1.0.168. Based on my test, the newer version is compatible with Crosslight.
Personally, I always use the version shipped with Crosslight. The Business template is the first template that I choose when I need to make use of async and await. This project template will automatically configure the usage of Microsoft Async package.
Is there a reference or some documentation about Crosslight feature and assemblies or NuGet packages one has to reference to use this feature properly? So far the samples are the only source for this.
I created Crosslight project using Blank project template then make use of async/await. Microsoft Async and Microsoft BCL Build Components packagas are then installed.
Currently, I can't find reference or documentation about which NuGet packages that has to be installed to use async/await feature properly. I'll have this discussed with production team and let you know the result.
any updates about my proposal of enhencing the documentation.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname