Remote svg image .NET MAUI - maui

I can't display remote svg images in <Image> control.
Example:
When I try to display this image, I don't see anything.
<Image Source="https://www.meteosuisse.admin.ch/static/product/resources/weather-symbols/120.svg" />
It's the same with this image
<Image Source="https://en.wikipedia.org/wiki/Scalable_Vector_Graphics#/media/File:SVG_Logo.svg" />
But if I only change the url of the image with this one which is of type JPG, everything works
<Image Source="https://aka.ms/campus.jpg" />
Am I doing something wrong?
.NET MAUI Version: 6.0.548
Microsoft Visual Studio Enterprise 2022 (64 bits) - Current
Version 17.4.3
Best Regards
Tested on
Windows (net6.0-windows10.0.19041.0)
Android (net6.0-android)
I have see this question but here, the problem is only with SVG remote image.

Related

Can I use existing WinUI3 controls in MAUI project?

Is it possible to use the exisiting controls of WinUI 3 in the MAUI project? Like controls in https://github.com/microsoft/WinUI-Gallery
I installed the WinUI package to my MAUI project
<ItemGroup>
<PackageReference Include="Microsoft.UI.Xaml" Version="2.7.1" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.1" />
</ItemGroup>
And edit the App.xaml
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:MauiWithWinui"
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
x:Class="MauiWithWinui.App">
<Application.Resources>
<controls:XamlControlsResources>
<controls:XamlControlsResources.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</controls:XamlControlsResources.MergedDictionaries>
</controls:XamlControlsResources>
</Application.Resources>
</Application>
as well as Platform/Windows/App.xaml
<maui:MauiWinUIApplication
x:Class="MauiWithWinui.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:MauiWithWinui.WinUI"
xmlns:controls="using:Microsoft.UI.Xaml.Controls">
<Application.Resources>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls"/>
</Application.Resources>
</maui:MauiWinUIApplication>
but when I went to use the WinUI control under a Page of MAUI, it prompted that the control could not be found
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="using:Microsoft.UI.Xaml.Controls"
x:Class="MauiWithWinui.MainPage">
<Grid>
<controls:RatingControl AutomationProperties.Name="RatingControl with placeholder" PlaceholderValue="3" />
</Grid>
</ContentPage>
the MAUI project only targeted to windows platform, though i know winui3 project is a better choice
You are mixing frameworks. If you want to use a WinUI control, you are almost right except for the last step where you are adding the WinUI control into Maui XAML.
What you need to do is create a handler that sits between the maui page and the platform view: https://github.com/mattleibow/MauiWinUIRatingControlDemo
Th reason this is needed is that this code will also run on Android, so that needs to also do something. If you try build your code for Android now, it is impossible to even compile. MAUI sits in between and forms an abstraction that allows you do something else for each platform.
If you run my code on Windows with the handler, you get the rating control. If you run it on Android, you get a blank view as the Android handler is not yet created. You can then decide how you want to make this handler for Android or iOS and hook up events and properties accordingly.

Getting Error HTTP Error 500.34 - ANCM Mixed Hosting Models Not Supported after HTTP Error 500.35 - ANCM Multiple Hosting models not supported

I am getting error "Error HTTP Error 500.34 - ANCM Mixed Hosting Models Not Supported" after adding
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
to my application.config.host, I was trying to resolve HTTP Error 500.35 - ANCM Multiple Hosting models not supported by adding above code snippet to application.config.host. Any help would be appreciated. Thanks
This issu occured because you may have different hosting model on you web apps under the same server where you have hosted your all web apps ,so you need to change hosting model for all ur web apps to be outofprocess by adding below line
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
I got the same error when I changed target SDK to .Net Core 3.1.
My solution was remove hostingModel="inprocess" from aspNetCore tag in file web.config.
Sure it can be made cleaner, but at least the app works.
Hope it may help someone.
<aspNetCore processPath="dotnet" arguments=".\XXXXXXX.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess"/>
I got it resolved.
I was loking for my applicationhost.config file in the .vs folder, to start i was unble to find .vs folder in my project folder. I manually typed C:\Users\v-wauddi\Desktop\Dutch Treat\DutchTreat.vs\DutchTreat\config\applicationhost.config and i was able to get applicationhost.config, I saw an unusual entry, I fixed it by commenting that unsual entry which can be seen in the below code.
<site name="DutchTreat" id="2">
<application path="/" applicationPool="DutchTreat AppPool">
<virtualDirectory path="/" physicalPath="C:\Users\v-
wauddi\Desktop\Dutch Treat\DutchTreat\DutchTreat" />
</application>
//commented out section
<!--<application path="/App" applicationPool="App AppPool">
<virtualDirectory path="/" physicalPath="C:\Users\v-
wauddi\Desktop\Dutch Treat\DutchTreat\DutchTreat" />
</application>-->
<bindings>
<binding protocol="http" bindingInformation="*:8888:localhost" />
</bindings>
</site>
I was going mad due to this issue from last 30-40 minutes. At last I deleted the .vs folder and reopened the project.
It works like charm.
Steps:
Open your solution folder.
exit project and close visual studio.
delete the vs folder, it might be hidden, so you need to enable
hidden items as shown below :
At last reopen project, it will take some extra seconds to reconstruct the files in .vs folder.

Google Chrome Canary Version 54.0.2830.0 not loading Type script source

I am using Google Chrome canary Version 54.0.2830.0. Typescript files are there but those are not loading the code to debug.
Posting an answer here so that it may help others.
I was using visual studio Web API project and project settings were not allowing client the access to static files. Due to which chrome was unable to load the Typescript files and map files.
To solve this, i had to add the following line in my web.config file to allow state contents.
<system.webServer>
<staticContent>
<mimeMap fileExtension=".ts" mimeType="application/x-typescript" />
</staticContent>
</system.webServer>

SAP Crystal Reports Viewer does not display in browser

I own a ASP.NET web project with framework 4.5. Is installed and implemented an SAP report for VS2012 Crystal Reports Developer.
Making in Local report, it works correctly in browsers (Chrome, Firefox, IE) and the data in the correct exit. Now, at the time of publishing (on another server) the first thing we did was install the same version of SAP, so that there are the necessary libraries etc..
The problem I have is that the block of Report Viewer, I mean, what is the repot container, not shown in the browser, open the window where is this embedded but not shown anything in the Report Viewer, what the report will look even less.
Thinking it might be a data error or something, I tried to change the report and put a blank, where all that is shown is a text, and no connections or anything like that and removing the code that is not needed in the code behind, I just stopped loading the report.
In new local works, but on the web published, the Report Viewer still be
Anybody can help me a bit? I looking for some information about it but what I find in forums related, is that the report is not seen, but nothing of Report Viewer.
Thank you very so much in advance.
PS: I have checked the server log for error to any issue or Asp.Net Crystal Reports and not leave anything.
I have smiler problem and found a solution.
I think there is some problem in finding Resource from default Resource-Uri for formatting of crystal report.
For proper formatting
Copy C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13 this folder into your project.
And past these lines into your web.config file
<configSections>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null" />
<section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />
</sectionGroup>
</sectionGroup>
</configSections>
<businessObjects>
<crystalReports>
<rptBuildProvider>
<add embedRptInResource="true" />
</rptBuildProvider>
<crystalReportViewer>
<add key="ResourceUri" value="/crystalreportviewers13" />
</crystalReportViewer>
</crystalReports>
</businessObjects>
Check this
This will help you.
Solved.... 100 % 'll work. Follow the below two steps:
1.Update Application Folder.
"C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13"
into your application root folder asp below snapshot.
Update Web.Config file by the following code.
After copying the folder "C:\inetpub\wwwroot\aspnet_client\system_web\4_0_30319\crystalreportviewers13" into your application root folder, be sure you copy and paste the give code:
<configSections>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null" />
<section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />
</sectionGroup>
</sectionGroup>
</configSections>
<businessObjects>
<crystalReports>
<rptBuildProvider>
<add embedRptInResource="true" />
</rptBuildProvider>
<crystalReportViewer>
<add key="ResourceUri" value="/crystalreportviewers13" />
</crystalReportViewer>
</crystalReports>
</businessObjects>
Right after < configuration > tag in web.config file. for me any other place did not work and generated Error message.
For me, the webpage Developer Tools (F12 then Console tab) showed that the server was looking for root/aspnet_client/system_web/4_6_1069 folder when I had copied the files into the 4_0_30319 folder. I renamed the folder and BAM!
I believe you need to deploy it as .Net 4, not .Net 4.5.
For those of us running migrated projects from .Net 4.0 or lower to 4.5+ I have made an observation. It seems if your page that contains the viewer is in a subdirectory then the image urls are being generated relative to that page and not to the root of the web application. E.g if your page is /gl/accounts.aspx then the image may be /gl/crystalimagehandler.aspx etc A quick way to fix this is to change your handler mapping to a wildcard ending in crystalimagehandler.aspx or put the following code in Global.asax
protected void Application_BeginRequest(object sender, EventArgs e)
{
var p = Request.Path.ToLower().Trim();
if (p.EndsWith("/crystalimagehandler.aspx") && p!= "/crystalimagehandler.aspx")
{
var fullPath=Request.Url.AbsoluteUri.ToLower();
var index = fullPath.IndexOf("/crystalimagehandler.aspx");
Response.Redirect(fullPath.Substring(index));
}
}
I had a situation where I had some Crystal Reports created using connection "SQL Server Native Client 11.0" and some using connection "Microsoft OLE DB Provider for SQL Server". Both worked on our old server running IIS 6. However, when we migrated over to a new server running IIS 8.5, some reports worked as expected, while others displayed an empty Crystal Reports viewer. After 4-5 days of pulling my hair out and trying everything I could think of, I finally compared everything between the reports that worked vs. the reports that did not work. What I discovered was the reports that worked used the "Microsoft OLE DB Provider for SQL Server" connection. Once I made this change, the reports served up perfectly.

how to try SourceMaps with GWT?

https://plus.google.com/u/1/110412141990454266397/posts/Nvr6Se6eAPh
does anyone know how to try it with last build of GWT (from svn) and Chrome Canary?
See http://code.google.com/p/google-web-toolkit/wiki/SourceMaps
it's only a matter of adding the following to your gwt.xml:
<set-property name="compiler.useSourceMaps" value="true" />
The compiler will then output source maps and the necessary triggers in the JS code (currently only for the safari permutation, to target Chrome only).
Beware, it's rather resource consuming! Be prepared to bump your -Xmx et al.