On Xamarin Forms I am using Prism MVVM.
After doing some update these two package Microsoft.AspNetCore.SignalR.Client 1.1.0->3.0.0 and Microsoft.Extensions.Caching.Memory 2.2.0->3.0.0 my application showing only white screen.
Can not see login page.
I only update these two package. Deleted bin and obj folder and it did not help
Other packages version:
Prism.Forms-> 7.2.0.1367
Xamarin.Forms ->4.2.0.815419
Any idea ?
EDIT:
All package I am using :
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client">
<Version>1.1.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Caching.Memory">
<Version>3.0.0</Version>
</PackageReference>
<PackageReference Include="NdefLibrary">
<Version>4.1.0</Version>
</PackageReference>
<PackageReference Include="Prism.Core">
<Version>7.2.0.1367</Version>
</PackageReference>
<PackageReference Include="Prism.Forms">
<Version>7.2.0.1367</Version>
</PackageReference>
<PackageReference Include="Prism.Plugin.Popups">
<Version>7.2.0.573</Version>
</PackageReference>
<PackageReference Include="Prism.Unity.Forms">
<Version>7.2.0.1367</Version>
</PackageReference>
<PackageReference Include="Rg.Plugins.Popup">
<Version>1.1.5.188</Version>
</PackageReference>
<PackageReference Include="System.Buffers">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="System.Memory">
<Version>4.5.3</Version>
</PackageReference>
<PackageReference Include="Xam.Plugins.Notifier">
<Version>3.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
<PackageReference Include="Xamarin.Essentials">
<Version>1.3.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.2.0.815419" />
<PackageReference Include="Xamarin.Forms.Visual.Material">
<Version>4.2.0.815419</Version>
</PackageReference>
<PackageReference Include="Xamarin.HotReload">
<Version>1.4.19</Version>
</PackageReference>
<PackageReference Include="ZXing.Net.Mobile">
<Version>2.4.1</Version>
</PackageReference>
<PackageReference Include="ZXing.Net.Mobile.Forms">
<Version>2.4.1</Version>
</PackageReference>
</ItemGroup>
EDIT : Found new error
Now I am getting these error. I got this error first removed signalR and readded it and checked the all "Common Language Runtime Exceptions"
System.TypeLoadException: 'Could not load type of field
'Microsoft.AspNetCore.Http.Features.Authentication.HttpAuthenticationFeature:<Handler>k__BackingField' (1)
due to: Could not resolve type with token 01000080 from typeref (
expected class 'Microsoft.AspNetCore.Http.Features.Authentication.IAuthenticationHandler' in assembly
'Microsoft.AspNetCore.Http.Features, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60')
assembly:Microsoft.AspNetCore.Http.Features, Version=2.2.0.0, Culture=neutral,
PublicKeyToken=adb9793829ddae60 type:Microsoft.AspNetCore.Http.Features.Authentication.IAuthenticationHandler
member:(null)'
in debug windows
**System.TypeLoadException:** 'Could not load type of field 'Microsoft.AspNetCore.Http.Features.Authentication.HttpAuthenticationFeature:<Handler>k__BackingField' (1) due to: Could not resolve type with token 01000080 from typeref (expected class 'Microsoft.AspNetCore.Http.Features.Authentication.IAuthenticationHandler' in assembly 'Microsoft.AspNetCore.Http.Features, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60') assembly:Microsoft.AspNetCore.Http.Features, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 type:Microsoft.AspNetCore.Http.Features.Authentication.IAuthenticationHandler member:(null)'
**System.Reflection.TargetInvocationException:** 'Exception has been thrown by the target of an invocation.'
**Unity.ResolutionFailedException:** 'For more information add Diagnostic extension: Container.AddExtension(new Diagnostic())'
**Prism.Navigation.NavigationException:** 'An error occurred while resolving the page. This is most likely the result of invalid XAML or other type initialization exception'
**Prism.Navigation.NavigationException:** 'An error occurred while resolving the page. This is most likely the result of invalid XAML or other type initialization exception'
In the pages code behind wrap the initialiseComponent() in a try catch and see what the error is with a breakpoint. White screen usually means Xaml issue
Related
..........
general info:
OS: Linux mint Debbie
code-editor: vs code
tutorial i'm following :https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/adding-model?view=aspnetcore-3.1&tabs=visual-studio-code
...........
when i run:
dotnet aspnet-codegenerator -h
i get this(and the options/args list) :
No code generators are available in this project. Please add the 'Microsoft.VisualStudio.Web.CodeGeneration.Design' NuGet package to the project.Please add Microsoft.VisualStudio.Web.CodeGeneration.Design package to the project as a NuGet package reference.
the package is already added here us the csproj file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="3.1.7" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.7" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="3.1.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.7">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SQLite" Version="3.1.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.7">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.4" />
</ItemGroup>
</Project>
when i try to create a a view I (predictably) get this:
dotnet-aspnet-codegenerator view -name myView
i get:
Building project ...
Finding the generator 'view'...
No code generators found with the name 'view'
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGeneratorsLocator.GetCodeGenerator(String codeGeneratorName)
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)
I have a multi-project solution that was working fine in VS2017, I've installed VS2019 and on compile I receive five error messages:
Four of the format: This version of Microsoft.AspNetCore.App is only compatible with netcoreapp2.2 taret framework. Please target netcoreapp2.2 or chose a version of Microsoft.AspNetCore.app compatible with netcoreapp3.1
And one of the format: Project '..\project-path\project.csproj' targets 'netcoreapp3.1;. It cannot be reference by a project that targets '.NETCoreApp,Version=v2.2'
Additionally if you look at the projects referenced in the error messages the Dependencies, Packages, SDK all have the yellow warning symbol on them (hover and right-click don't seem to provide additional details)
I've tried cleans, delete bin and obj folders, rebuilds, checking SDK versions, but no luck
I can confirm I have a global.json with the SDK version (2.2.103) and that when in any of these projects directories and I run 'dotnet --verson' I get back 2.2.103
What is happening here? What / where is it picking up netcoreapp3.1 from and how do I resolve these errors?
Update: CSPROJ Details
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
<None Include="appsettings.json" CopyToOutputDirectory="Always" />
<None Include="favicon.ico" CopyToOutputDirectory="Always" />
<None Include="appDevLocalOverride.json" />
<PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="3.1.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.8.1" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.AzureKeyVault.HostingStartup" Version="2.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.2" />
<PackageReference Include="Microsoft.Azure.KeyVault" Version="3.0.3" />
<PackageReference Include="Microsoft.Azure.Services.AppAuthentication" Version="1.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="2.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" />
</ItemGroup>
I'm not sure why or how this works, but I have stumbled on a solution:
Open the csproj
Edit <PackageReference Include="Microsoft.AspNetCore.App" /> to <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" />
Build > Clean Solution
Manually remove ALL bin and obj folders (even if they are only remotely related to the solution)
Build > Rebuild Solution
Edit <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.0" /> to <PackageReference Include="Microsoft.AspNetCore.App" />
That seemed to work for me, why a simple Clean Solution and Rebuild wasn't the answer is odd; but hopefully this will help someone else!
Where using .netcore 2.2 an upgrade to .netcore 3.0
This is the error that we encounter when running unit test:
"Could not load type 'Context' from assembly 'Microsoft.AspNetCore.Hosting, Version=3.0.0.0"
These steps work on our project:
Remove old packages
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Cors" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
Install
Microsoft.AspNetCore.Mvc.Testing 3.0.0-preview7.19365.7
Update Startup.cs
.AddApplicationPart(Assembly.Load("YourProjectControllerNamespace"))
I have this packages in a project:
<PackageReference Include="Microsoft.CodeAnalysis" Version="2.8.2" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="1.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="2.8.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.8.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.8.2" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="2.8.2" />
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="2.8.2" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="2.8.2" />
I moved this .csproj file to 2017 format, and then, when I build the solution, there is an error:
error CS0104: 'Project' is an ambiguous reference between
'Microsoft.CodeAnalysis.Project' and 'Some.Namespace.Project'
Of course, this error is because one of the packages described above moved to parent common project and conflicts with class with the same name.
My question is which assets (IncludeAssets, ExcludeAssets, PrivateAssets) should I set, with what value, and in which package?
For now, the .csproj file looks like this:
<PackageReference Include="Microsoft.CodeAnalysis" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="1.1.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
But I think that this is not the best and precise option.
The best thing to do here is to create a brand new blank project. Make a reference to the 2.8.2 version then compare what is in the csproj file against your real solution. Remove any references in your real solution that are not In your dummy file. It may well be that namespaces have changed, but at least once you get the references right, namespaces shouldn't be so difficult.
I am getting this cryptic error after updating my ASP.NET MVC Service running in Service Fabric. After a lot of faffing around with the actual upgrade I managed to get it running on my local Service Fabric on my machine.
I am now trying to deploy it to an actual Service Fabric cluster. I am now getting errors such as:
Error RZ3501: Invalid tag helper bound property 'RouteValues' on tag helper 'Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper'.
'Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeNameAttribute.DictionaryAttributePrefix' must be null unless property type implements 'IDictionary<string, TValue>'.
(0,0): Error RZ3501: Invalid tag helper bound property 'RouteValues' on tag helper 'Microsoft.AspNetCore.Mvc.TagHelpers.FormActionTagHelper'.
Note that I have not changed any code during the upgrade of the ASP.NET MVC service to version 2.0
This is a sample of how I used TagHelpers:
#{
IDictionary<string,string> routeData = SpecialMethodThatCalculatesRouteData();
}
<a asp-route="MyRoute" asp-all-route-data="#routeData" >
This code worked fine before the upgrade.
Has anybody stumbled upon this?
Thanks
EDIT: These are the references I have in the csproj file:
<PackageReference Include="CompressedStaticFiles" Version="1.0.3" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0" />
<PackageReference Include="Microsoft.ServiceFabric" Version="5.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.AspNetCore.WebListener" Version="2.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.Data" Version="2.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="2.7.198" />
<PackageReference Include="Microsoft.ServiceFabric.Services.Remoting" Version="2.7.198" />
<PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="2.0.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric.Native" Version="1.0.0-beta2" />
<PackageReference Include="NETStandard.Library.NETFramework" Version="2.0.0-preview2-25405-01" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="React.AspNet" Version="3.1.0" />
<PackageReference Include="Microsoft.Azure.DocumentDB" Version="1.17.0" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="2.0.0" />
EDIT: More info. I had to add these tasks to my build definition in VSTS to get the project to compile
I just ran into the same problem, setting the vsts build to 'clean' seemed to resolve it.
I had a global.json file pointing against an old SDK (1.1), removing that file solved this problem for me.
Turns out that our build agent had VS version 15.2 and by upgrading the build agent to the latest version 15.5, that solved the problem.