According to this post: https://devblogs.microsoft.com/xamarin/embedded-fonts-xamarin-forms/
The new way to add a custom font is to add the font as an embeddedResource and then add this line in App.xaml.ca:
[assembly: ExportFont("DSEG7ModernRegular.ttf")]
But I get this error:
Error CS0246 The type or namespace name 'ExportFontAttribute' could not be found (are you missing a using directive or an assembly reference?)
My project references:
Xamarin.Essentials (1.3.1)
Xamarin.Forms (4.4.0.991265) - 4.5
NetStandard.Library (2.0.3)
ExportFontAttribute is in the Xamarin.Forms namespace, so be sure you have
using Xamarin.Forms;
Related
I am using .NET Core 3.0.100 ; Microsoft Visual Studio Community 2019 Preview Version 16.4.0 Preview 1.0 ; Blazor-server (official release).
I am trying to add Authentication and Authorization to my Blazor-server web app. I am reading the guideline at here https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-3.0&tabs=visual-studio#scaffold-identity-into-an-empty-project
(I also read this https://github.com/aspnet/Identity/issues/1825)
Then I right-click on Project, choose Add \ New Scaffolded Item...
I read the file ScaffoldingReadme.txt, then follow the guide.
I press F5 for debugging, I catch the error.
Severity: Error
Error Code: CS0246
Description: The type or namespace name 'IWebHostEnvironment' could not be found (are you missing a using directive or an assembly reference?)
Project: foo
File: C:\Users\donhuvy\Desktop\foo\bar\obj\Debug\netcoreapp3.0\Razor\Pages\Shared\_Layout.cshtml.g.cs
Line: 455
Suppression State: Active
Screenshot
Because file \obj\Debug\netcoreapp3.0\Razor\Pages\Shared\_Layout.cshtml.g.cs stand inside Razor Class Library Microsoft.AspNetCore.Identity.UI (3.0.0), I cannot edit it.
How to fix it?
This is an issue,
The code generate is
Microsoft.AspNetCore.Hosting
#using Microsoft.AspNetCore.Mvc.ViewEngines
#inject IWebHostEnvironment Environment
#inject ICompositeViewEngine Engine
it is missing #using
it should be
#using Microsoft.AspNetCore.Hosting
I reported issue at https://github.com/aspnet/Scaffolding/issues/1094
Issue solved by adding in our csproj file (3.1 core app):
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
I am getting the following error:
Error CS0234: The type or namespace name 'CarouselView' does not exist
in the namespace 'Xamarin.Forms' (are you missing an assembly reference?)
(CS0234) (your project)
Using this on the XAML
xmlns:controls="clr-namespace:CarouselView.FormsPlugin.Abstractions;assembly=CarouselView.FormsPlugin.Abstractions"
Name of the package is: CarouselView.FormsPlugin.
Update......
xaml
As per the project documentation on GitHub, there are several steps you need to do to enable the plugin:
Install the package via NuGet
Initialize the plugin
On Universal Windows Platform include with Xamarin.Forms initialization:
List<Assembly> assembliesToInclude = new List<Assembly>();
assembliesToInclude.Add(typeof(CarouselViewRenderer).GetTypeInfo().Assembly);
Xamarin.Forms.Forms.Init(e, assembliesToInclude);
On iOS and Android right after Xamarin.Forms initialization:
Xamarin.Forms.Init();
CarouselViewRenderer.Init();
Use in XAML
For XAML usage, you need to include a different namespace (CarouselView.FormsPlugin.Abstractions) than you noted in the question:
xmlns:controls="clr-namespace:CarouselView.FormsPlugin.Abstractions;assembly=CarouselView.FormsPlugin.Abstractions"
And now use as:
<controls:CarouselViewControl ...>
I need to generate a class from an xsd in net core.
In dotnet standard I used commandline xsd filename.xsd /c.
But how to I create this class in net core.
Anyone knows how to do this?
When I add a class generated with xsd.exe I get several errors.
Example
Error CS0234 The type or namespace name 'SerializableAttributeAttribute' does not exist in the namespace 'System' (are you missing an assembly reference?)
Error CS0234 The type or namespace name 'DesignerCategoryAttribute' does not exist in the namespace 'System.ComponentModel' (are you missing an assembly reference?)
Error CS0234 The type or namespace name 'XmlTypeAttributeAttribute' does not exist in the namespace 'System.Xml.Serialization' (are you missing an assembly reference?)
Error CS0246 The type or namespace name 'AnonymousType' could not be found (are you missing a using directive or an assembly reference?)
Attributes from a class in autogen file
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1055.0")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
I have now solved this issue with adding nugets to my project.
System.Xml.XmlSerializer
Solution: Removes the serializations attribute issues except the DesignerCategoryAttribute
Newtonsoft.json
Solution: Removes the DesignerCategoryAttribute
Now it is possible to compile the xsd.exe generated class and use it in net core
netstandard2.0 can compile xsd.exe generated files with no problems
There is no way actualy but if you see this it's a part of the future .net core release (.Net Core 1.2 release on Q2 2017).
If you want more Info, see this discuss and specially this point.
I have a web site built with Orchard, including a custom theme.
I added ReactJS.net to the theme via NuGet. It compiles fine, but when I try to render a view, I get the following error:
CS0246: The type or namespace name 'React' could not be found (are you missing a using directive or an assembly reference?)
React.Core, React.Web and React.Web.Mvc4 all appear in the project's References.
I'm at a loss as to why the view isn't finding React. Do I also need to include ReactJS.net in other Orchard projects for some reason?
I am getting an error:
Error 1 The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?) c:\users\klippiat\documents\visual studio 2010\Projects\TfsPortal\TfsPortal\Models\ApiModel.cs 5 23 TfsPortal
I would normally Add Reference and select the missing reference. But System.Web.Http.Description is missing from the list. I have sorted the list by name to make sure that I should be able to see it. I can see System.Web.Http.Data and .Common etc. but not the .Description one.
What am I doing wrong?
Visual Studio 2012 SPA Template /Help/index.cshtml file was throwing your error.
#using System.Web.Http
#using System.Web.Http.Description <=== CS0234: The type or namespace name 'Description' does not exist in the namespace 'System.Web.Http' (are you missing an assembly reference?)
Solution: Set "Copy Local : True" in properties for References\System.Web.Http
You aren't doing anything wrong. There is just some configuration problem that prevents Visual Studio from adding the reference to the list of assemblies for the compiler to check.
Types in the System.Web.Http.Description are found in the System.Web.Http.dll assembly, which is found in a Nuget package folder.
You can type Uninstall-Package Microsoft.AspNet.WebApi in the NuGet Package Console and then type Install-Package Microsoft.AspNet.WebApi to re-install it at which point, the reference will be fixed.
I un-installed MVC4 and reinstalled from a fresh download. I had to create a NEW project again and the Description namespace appeared.
The strange thing is if I open the old project the Description namespace is still missing when I try to add a using...
I was also facing the same issue when while creating a SPA solution by using MVC-4 framework.
I resolved this by setting the Copy Local : True in properties for the reference System.Web.Http.
I had the same problem. I was opening the project as a website instead of project/solution. So, after opening the solution it solved my problem.