我有一个由asp.net core 2.1制作的项目,现在我想迁移到2.2版本.
我安装了2.2的SDK,并在项目的属性中将目标框架更改为2.2.
在我清理并重建解决方案之后,这里有一些警告,我无法清理它:
1.
我找到了一个由Microsoft提供的关于此的教程:https:
//docs.microsoft.com/en-us/aspnet/core/migration/21-to-22?view=aspnetcore-2.2&tabs=visual-studio
我试过但是仍然没有工作.
我认为通过更改项目属性中的目标框架,更新新版SDK就像.net框架一样.但是,似乎没有.
我想知道是否有一个官方工具可以将.net核心SDK从2.1更新到2.2.或者我最好创建一个全新的2.2项目,并将所有文件粘贴到其中,而不是修复麻烦的警告.
谢谢.
这是我的代码:
[HttpPost]
[Produces("application/xml")]
public async Task<xml> mp([FromBody]xml XmlData)
{
xml ReturnXmlData = null;
ReturnXmlData = new xml()
{
ToUserName = XmlData.FromUserName,
FromUserName = XmlData.ToUserName,
CreateTime = XmlData.CreateTime,
MsgType = "text",
Content = "Hello world"
};
return ReturnXmlData;
}
[XmlRoot("xml")]
public class xml
{
public string ToUserName { get; set; }
public string FromUserName { get; set; }
public string CreateTime { get; set; }
public string MsgType { get; set; }
public string MsgId { get; set; }
public string …
Run Code Online (Sandbox Code Playgroud) 我想在 WPF 中显示 SVG 文件,我发现很多人推荐使用sharpvectors
.
我将它与 XAML 一起使用,如下所示:
<Window x:Class="KongGamLung.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:KongGamLung"
xmlns:SVG="http://sharpvectors.codeplex.com/svgc/"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
<SVG:SvgViewbox Source="Create.svg" AutoSize="True" OptimizePath="False" TextAsGeometry="True"></SVG:SvgViewbox>
</Grid>
</Window>
Run Code Online (Sandbox Code Playgroud)
为什么会变成这样?更重要的是,我在 NUGET 中尝试了几个 SVG 包。但它们比这更糟糕,即使在编辑器中也无法显示。
我该如何解决这个问题?如果有比这更好的 SVG 包,请推荐给我。谢谢你。
这是我的代码:
@page "/"
<button onclick="AddClick">Add</button>
@{
foreach (string i in StringList)
{
<div>@i</div>
}
}
@code{
public List<String> StringList { get; set; }=new List<string>() {"555","666"};
public void AddClick()
{
StringList.Add(DateTime.Now.ToString());
}
}
Run Code Online (Sandbox Code Playgroud)
当我单击按钮时,它确实起作用了。
我认为这是因为我尚未绑定列表。同时,如何绑定列表?
你能帮我吗?谢谢。