小编Dan*_*tin的帖子

Lottie.Forms - 从 EmbeddedResources 加载

AnimationView在 AirBnb 的Lottie框架中定义了一个文件,它应该加载一个文件,该文件放置在我的 Xamarin.Forms 项目(便携式项目)内的 Resource 文件夹中

        <forms:AnimationView
            x:Name="AnimationView"
            Animation="SharpLibrary.Forms.Assets.Images.WineGlass.json"
            Loop="True"
            AutoPlay="True"
            VerticalOptions="FillAndExpand"
            HorizontalOptions="FillAndExpand" />
Run Code Online (Sandbox Code Playgroud)

但它似乎无法解析Animation属性中的字符串,因此它不会显示动画。如果我将文件放入 Resource 文件夹并说它Animation="WineGlass.json"有效。

有没有办法从 EmbeddedResource 加载它,或者这是不可能的?

c# xamarin.forms lottie

14
推荐指数
1
解决办法
534
查看次数

Xamarin.Forms.UWP - 错误PRI175

我的解决方案中有3个项目.

  • 项目A(Xamarin.Windows.UWP - 这是可执行的项目)(参考项目B + C)
  • 项目B(Xamarin.Forms - 这是一个类库)
  • 项目C(Xamarin.Forms.UWP - 作为渲染器库)(参考项目B)

这里的问题是,如果项目A同时引用B + C,我在构建时会遇到2个错误:

  • 错误PRI175 - 重复输入
  • GENERATEPROJECTPRIFILE - 0xdef00532 - 资源的冲突值"

不幸的是,这就是我得到的一切.从项目A中删除参考项目C或B可以让我构建没有任何问题,但我需要项目A中的项目B + C的类.

那么,有没有人知道什么导致这些构建错误?

非常感谢你的帮助!

编辑:

我重新创建了结构,出现了同样的错误.解决方案可以在这里找到.打开TestSolutionC,构建TestSolutionC.UWP

c# xamarin uwp

8
推荐指数
1
解决办法
881
查看次数

aspNetCore 2.2.0-AspNetCoreModuleV2错误

将项目更新为“ Microsoft.AspNetCore.All” 2.2.0之后,在IIS中运行时出现错误,但在Visual Studio中运行时却没有错误。

HTTP-Fehler 500.21 - Internal Server Error Der Handler "aspNetCore" weist das ungültige Modul "AspNetCoreModuleV2" in der Modulliste auf.

我不知道是什么原因造成的,而www似乎没有答案。也许有人面对同样的事情并且有解决方案

c# asp.net asp.net-core

8
推荐指数
2
解决办法
2万
查看次数

错误:操作具有与请求正文绑定的多个参数

我在ASP.Net MVC项目的控制器中写了一个新方法,并在下面出现错误。我认为InvalidOperationException来自Swagger。我将其标记为“ ignored Api”,希望它将跳过该方法,但错误仍然存​​在:

[ApiExplorerSettings(IgnoreApi = true)]
public decimal CalculatePriceWithCampaign(
       BeverageCapacityCampaign campaign, 
       BeverageCapacity capacity,
       int count = 1)
{
    switch (campaign.DiscountType)
    {
        case DiscountType.Fixed:
            return (capacity.CapacityPrice - campaign.DiscountValue) * count;
        case DiscountType.Percentage:
            return (capacity.CapacityPrice * count) * campaign.DiscountValue;
        default:
            return capacity.CapacityPrice;
    }
}
Run Code Online (Sandbox Code Playgroud)

但是在运行时出现此错误:

处理请求时发生未处理的异常。

InvalidOperationException:操作'Gorilla.WebApi.Source.Controller.Campaigns.BeverageCapacityCampaignController.CalculatePriceWithCampaign(Gorilla.WebApi)'具有多个参数,这些参数已从请求正文中指定或推断为绑定。每个动作只能绑定一个参数。检查以下参数,并使用'FromQueryAttribute'指定从查询绑定的边界,'FromRouteAttribute'指定从路由绑定的边界,以及'FromBodyAttribute'用于从body绑定的参数:
BeverageCapacityCampaignCampaign广告系列
BeverageCapacity容量

我可以找到建议检查nuget的信息,但是我所有的Nu​​get都是最新的。

c# asp.net-mvc

6
推荐指数
3
解决办法
4438
查看次数

Azure Devops macOS Pipeline 在托​​管时失败,缺少配置文件

我正在运行生成 .ipa 文件的 Azure DevOps Pipeline。它在我的本地代理上运行没有任何问题,但是当我在托管 macOS 10.15 计算机上运行它时,我会收到一个错误,提示配置文件丢失

\n

\xe2\x9d\x8c error: No profiles for 'app.zookeeper.platypus' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'app.zookeeper.platypus'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')

\n
- task: InstallAppleProvisioningProfile@1\n  displayName: 'Install an Apple provisioning profile'\n  inputs:\n    provProfileSecureFile: App.mobileprovision\n\n- task: InstallAppleCertificate@2\n  displayName: 'Install an Apple certificate'\n  inputs:\n    certSecureFile: 'Certs.p12'\n    certPwd: xxx\n\n- task: Xcode@5\n …
Run Code Online (Sandbox Code Playgroud)

xcode azure ios azure-devops azure-pipelines

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

使用 build_runner 进行 dart 模块化

我有一个项目,由一个可运行项目和多个本地包组成。这些包是模块和核心框架。我正在使用 json 序列化和其他依赖于build_runner. 我面临的问题是,如果我添加一个需要build_runner完成其工作的类,我总是必须导航终端内的文件夹,并build_runner手动运行。有没有办法告诉build_runner在所有本地包上运行或至少在定义的包上运行?

我在这里发现了另一个有同样问题的 SO 线程,建议使用build_config包,但我不确定,这个任务是否可以用这个包完成

dart flutter build-runner

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

使用自动增量插入

我正在尝试将一些数据插入到我的 SQLite 数据库中,当我使用一条记录执行此操作时,它可以完美地工作。但是在循环中我得到一个错误。首先,这是代码

string dataSource = "Data Source=";
Connection = new SQLiteConnection(dataSource + this.DatabasePath);

var context = new DataContext(Connection);

var users = context.GetTable<User>();


for (int i = 0; i < 2; i++) {
    User tempUser = new User() {
        ID = null,
        EMail = i + "@" + i + ".de",
        Password = "Test1234",
        JoinedDate = DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss")
    };

    users.InsertOnSubmit(tempUser);
    context.SubmitChanges();
}
Run Code Online (Sandbox Code Playgroud)

和用户本身

[Table(Name = "User")]
public class User {

    [Column(Name = "UserID", IsPrimaryKey = true, CanBeNull = false)]
    public …
Run Code Online (Sandbox Code Playgroud)

c# linq sqlite

5
推荐指数
1
解决办法
2010
查看次数

C# - Linq有两个列表

我有两个通过ID连接在一起的课程:

public class A {
    public int AID;
    public string Name;
}

public class B {
    public int BID;
    public int AID;
}
Run Code Online (Sandbox Code Playgroud)

现在我想过滤我的listB以获取所有B,其中A名称是euqals参数名称:

List<A> listA = ...;
List<B> listB = ...;

public List<B> Filter(string name) {
    var list = listB.Where(**... A.Name == name ...**).ToList();
    return list;
}
Run Code Online (Sandbox Code Playgroud)

我不知道如何使用上面定义的参数过滤listB.也许有人可以帮我搞清楚.

谢谢!

c# linq

5
推荐指数
2
解决办法
951
查看次数

Azure DevOps 中的 Flutter 管道

我正在尝试构建我的 Flutter iOS 应用程序,但我不知道如何获取 ipa 文件。

pool:
  name: Default
  demands: xcode

steps:
- task: aloisdeniel.flutter.flutter-install.FlutterInstall@0
  displayName: 'Flutter Install'

- task: aloisdeniel.flutter.flutter-build.FlutterBuild@0
  displayName: 'Flutter Build ios'
  inputs:
    target: ios
    projectDirectory: 'src/Apps/platypus_app'
    buildName: '$(Build.BuildNumber)'
    entryPoint: 'lib/main_staging.dart'
    iosCodesign: false

- task: CopyFiles@2
  displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
  inputs:
    SourceFolder: 'src/Apps/platypus_app/build/ios'
    TargetFolder: '$(build.artifactstagingdirectory)'

- task: InstallAppleCertificate@2
  displayName: 'Install an Apple certificate'
  inputs:
    certSecureFile: 'ZooKeeper_Certs.p12'
    certPwd: ZooK33periOSKeyStore

- task: PublishPipelineArtifact@1
  displayName: 'Publish Pipeline Artifact'
  inputs:
    targetPath: '$(build.artifactstagingdirectory)'
    artifact: 'platypus_drop'
Run Code Online (Sandbox Code Playgroud)

此管道已构建,但我得到以下输出:

在此处输入图片说明

没有 .ipa 文件,所以我认为我还需要做另一个步骤,但我不是 iOS 开发人员。

flutter azure-devops azure-pipelines

5
推荐指数
1
解决办法
2759
查看次数

Flutter GetIt 抛出实例异常

我正在尝试使用以下方法在我的 flutter 应用程序中注册我的服务get_it,并且需要在开始时使用异步调用初始化一个依赖项。 \n正如我在官方 Get_It pub 页面上所读到的那样,这应该不是问题,只要我正在为依赖项定义 dependentOn 属性,该属性依赖于该可初始化类。

\n

在我的示例中,DeviceInfo是需要初始化的类,并且Gateway两者WorkingTimeRepository都依赖于该类。两者都定义了它们的 dependentOn 属性。

\n
void setup() {\n  getIt.registerSingletonAsync<DeviceInfo>(() async => DeviceInfo.init());\n\n  getIt.registerSingletonWithDependencies(\n      () => Gateway(deviceInfo: getIt.get()),\n      dependsOn: [DeviceInfo]);\n\n  getIt.registerSingletonWithDependencies<WorkingTimeRepository>(\n      () => WorkingTimeRepository(\n          dio: new Dio(), httpHeader: new HttpHeader(), gateway: getIt.get()),\n      dependsOn: [DeviceInfo, Gateway]);\n}\n
Run Code Online (Sandbox Code Playgroud)\n

现在,当我的应用程序启动并且我的第一个 Widget 想要访问workingTimeRepository 时,我立即得到一个异常:

\n
\n

\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90 捕获异常通过小部件库 \xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\ x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\ xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\ x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\ x90\xe2\x95\x90\xe2\x95\x90\n构建 MainView 时抛出以下断言:\n您尝试访问尚未准备就绪的 WorkTimeRepository 实例\n\'package:get_it/get_it_impl.dart\': \n断言失败:第 322 行第 14 行:\'instanceFactory.isReady\'

\n
\n

我找不到我犯的错误,而且我认为在访问注册类型时,它会解决所有依赖项

\n …

dependency-injection dart flutter

4
推荐指数
1
解决办法
4566
查看次数