小编Mak*_*luv的帖子

在UWP项目中使用Akavache + Mobile Center时出错

我有UWP应用程序并使用Akavache.添加MobileCenter NuGet包后,我在构建应用程序时遇到了这个问题:

Payload contains two or more files with the same destination path 'SQLitePCLRaw.batteries_v2.dll'. 
Source files:C:\Users\user\.nuget\packages\SQLitePCLRaw.bundle_e_sqlite3\1.1.0\lib\uap10.0\SQLitePCLRaw.batteries_v2.dll
C:\Users\user\.nuget\packages\SQLitePCLRaw.bundle_green\1.1.2\lib\uap10.0\SQLitePCLRaw.batteries_v2.dll
Run Code Online (Sandbox Code Playgroud)

如何在不删除Akavache或VSMC的情况下修复它?

akavache uwp mobile-center visual-studio-app-center

7
推荐指数
1
解决办法
314
查看次数

在WebView UWP中更改默认用户代理

我需要设置自定义UA并使用

httpRequestMessage.Headers.Add("User-Agent", "blahblah");
theWebView.NavigateWithHttpRequestMessage(httpRequestMessage);
Run Code Online (Sandbox Code Playgroud)

但是,如果我点击页面上的任何链接,这个UA会删除并设置默认UA.

我发现了同样的问题 WebView - 在每个请求上定义用户代理但是它可能在1607中修复了吗?

c# webview windows-store-apps win-universal-app uwp

6
推荐指数
1
解决办法
1875
查看次数

如何在 Refit 中禁用 urlencoding get-params?

我将 Refit 用于 RestAPI。我需要创建相同的查询字符串api/item?c[]=14&c[]=74

在改装界面中我创建了方法

[Get("/item")]
Task<TendersResponse> GetTenders([AliasAs("c")]List<string> categories=null);
Run Code Online (Sandbox Code Playgroud)

并创建 CustomParameterFormatter

string query = string.Join("&c[]=", values);
Run Code Online (Sandbox Code Playgroud)

CustomParameterFormatter 生成的字符串 14&c[]=74

但是 Refit 编码参数和生成的 url api/item?c%5B%5D=14%26c%5B%5D%3D74

如何禁用此功能?

.net c# refit uwp

6
推荐指数
1
解决办法
1717
查看次数

C#9 不支持 JsonPropertyNameAttribute 记录?

我想使用带有 JsonPropertyName 属性的记录,但它导致了错误。这个不支持?任何解决方法?

public record QuoteResponse([JsonPropertyName("quotes")] IReadOnlyCollection<Quote>? Quotes);

Error CS0592 Attribute 'JsonPropertyName' is not valid on this declaration type. It is only valid on 'property, indexer, field' declarations.
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

c# .net-5 system.text.json c#-9.0

4
推荐指数
2
解决办法
372
查看次数