ResolveBlazorRuntimeDependencies compile Error when adding Telerik Package

9 posts, 0 answers
  1. Nick
    Nick avatar
    39 posts
    Member since:
    Nov 2016

    Posted 05 Dec 2019 Link to this post

    Hi,

     

    I'm getting an odd compile error having upgraded to the latest .Net 3.1. I've recreated the issue by simply creating a new Blazor (client) project and adding the Telerik package, it goes away when I remove it.

    VS 2019 16.5 preview 1. In the upgrade scenario I upgraded all the packages to 3.1.0-preview4.19579.2, obviously it picked these up when I created a new project as well.

    The error is:

    Severity    Code    Description    Project    File    Line    Suppression State
    Error    MSB4018    The "ResolveBlazorRuntimeDependencies" task failed unexpectedly.
    System.InvalidOperationException: Multiple assemblies found with the same assembly name 'Microsoft.CodeAnalysis.resources':
    Microsoft.CodeAnalysis.resources
    C:\Users\NickWhymark\.nuget\packages\microsoft.codeanalysis.common\3.4.0\lib\netstandard2.0\de\Microsoft.CodeAnalysis.resources.dll
       at Microsoft.AspNetCore.Blazor.Build.ResolveBlazorRuntimeDependencies.<ResolveRuntimeDependenciesCore>g__CreateAssemblyLookup|17_1(IEnumerable`1 assemblyPaths)
       at Microsoft.AspNetCore.Blazor.Build.ResolveBlazorRuntimeDependencies.ResolveRuntimeDependenciesCore(String entryPoint, IEnumerable`1 applicationDependencies, IEnumerable`1 monoBclAssemblies)
       at Microsoft.AspNetCore.Blazor.Build.ResolveBlazorRuntimeDependencies.Execute()
       at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
       at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()    BlazorApp1.Client    C:\Users\xxx\.nuget\packages\microsoft.aspnetcore.blazor.build\3.1.0-preview4.19579.2\targets\Blazor.MonoRuntime.targets    252    

    It's a bit odd as it seems to be something to do with Analyzers and I'm not sure why that should break the build or what Telerik has to do with it?

    Thanks,
    Nick.

  2. Nick
    Nick avatar
    39 posts
    Member since:
    Nov 2016

    Posted 05 Dec 2019 in reply to Nick Link to this post

    I forgot to say that I have tried with both 2.4 and 2.5 versions of the Telerik controls!
  3. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5067 posts

    Posted 05 Dec 2019 Link to this post

    Hi Nick,

    The Linker in Preview 4 is very aggressive and needs explicit configuration. Could you try applying the updated information from this section of the documentation: https://docs.telerik.com/blazor-ui/getting-started/what-you-need#client-side-project-considerations? In our tests adding the Linker.xml file with such a content let us run WASM apps. It fails on our assembly because we have extension methods, and they have been problematic for the linker since day 1.

     

    Regards,
    Marin Bratanov
    Progress Telerik

     UI for Blazor
  4. Nick
    Nick avatar
    39 posts
    Member since:
    Nov 2016

    Posted 05 Dec 2019 in reply to Marin Bratanov Link to this post

    Hi Marin,

    I tried that and it didn't seem to make a difference. I currently have <BlazorLinkOnBuild>false</BlazorLinkOnBuild> in the project file, so I'm not sure if the linker is running anyway?

    Thanks

    Nick.

     

  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5067 posts

    Posted 05 Dec 2019 Link to this post

    Try removing that line, Nick, we removed it from the docs as well.

     

    Regards,
    Marin Bratanov
    Progress Telerik

     UI for Blazor
  6. Nick
    Nick avatar
    39 posts
    Member since:
    Nov 2016

    Posted 05 Dec 2019 in reply to Marin Bratanov Link to this post

    That did the trick - thanks Marin. I suspect I'm going to have problems with my own references now, but you've pointed me in the right direction!

    Thanks again!
  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5067 posts

    Posted 05 Dec 2019 Link to this post

    Hello Nick,

    I just went through the steps to make sure things are ok, and I had missed adding an instruction for actually telling the linker to use this configuration file, you need to also add the following in your project file:

      <ItemGroup>
    	<BlazorLinkerDescriptor Include="Linker.xml" />
      </ItemGroup>

    I will put it live in the docs as soon as possible.

    Regards,
    Marin Bratanov
    Progress Telerik

     UI for Blazor
  8. Nick
    Nick avatar
    39 posts
    Member since:
    Nov 2016

    Posted 05 Dec 2019 in reply to Marin Bratanov Link to this post

    Thanks Marin, luckily I spotted that from the MSFT documention!
  9. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5067 posts

    Posted 05 Dec 2019 Link to this post

    Good catch, Nick! Since it's still better to have all the manual steps in one place - they are live now.

    --Marin

Back to Top