martasp / BlazorLiveReload

BlazorLiveReload
142 stars 14 forks source link

Exceptions when using Razor class library #12

Open jaredthirsk opened 4 years ago

jaredthirsk commented 4 years ago

I got it working within a standalone asp.net project (after realizing it was okay that the /preview page was blank until I changed something) but when trying to use a component in a separate DLL, I get this:

System.Exception: '/App.razor(1,35): warning CS0436: The type 'Counter' in '' conflicts with the imported type 'Counter' in '__Test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''.
/App.razor(2,46): error CS0246: The type or namespace name 'VosBlazorUtils' could not be found (are you missing a using directive or an assembly reference?)
/App.razor(5,71): warning CS0436: The type 'MainLayout' in '' conflicts with the imported type 'MainLayout' in '__Test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''.
/App.razor(8,42): warning CS0436: The type 'MainLayout' in '' conflicts with the imported type 'MainLayout' in '__Test, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in ''.
warning CS1702: Assuming assembly reference 'Microsoft.AspNetCore.Components, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'Microsoft.AspNetCore.Components.Web' matches identity 'Microsoft.AspNetCore.Components, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.AspNetCore.Components', you may need to supply runtime policy
warning CS1702: Assuming assembly reference 'Microsoft.AspNetCore.Components, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'Microsoft.AspNetCore.Components.Web' matches identity 'Microsoft.AspNetCore.Components, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.AspNetCore.Components', you may need to supply runtime policy
warning CS1702: Assuming assembly reference 'Microsoft.AspNetCore.Components, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'Microsoft.AspNetCore.Components.Web' matches identity 'Microsoft.AspNetCore.Components, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.AspNetCore.Components', you may need to supply runtime policy
warning CS1702: Assuming assembly reference 'Microsoft.AspNetCore.Components, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'Microsoft.AspNetCore.Components.Web' matches identity 'Microsoft.AspNetCore.Components, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.AspNetCore.Components', you may need to supply runtime policy
warning CS1702: Assuming assembly reference 'Microsoft.AspNetCore.Components, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' used by 'Microsoft.AspNetCore.Components.Web' matches identity 'Microsoft.AspNetCore.Components, Version=3.1.3.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' of 'Microsoft.AspNetCore.Components', you may need to supply runtime policy'

I tried referencing Microsoft.AspNetCore.Components.Web directly to avoid the warnings, but the key error is it can't find my class "VosBlazorUtils", even though it is found without using BlazorLiveReload.