将软件包"Xamarin.Forms"和"Xamarin.Forms.Maps"更新到最新版本即"3.0.0.446417"后,项目将不再构建,我收到此错误:
C:\Users\[MyUser]\.nuget\packages\xamarin.forms\3.0.0.446417\build\netstandard2.0\Xamarin.Forms.targets(35,3):
error MSB4062: The "Xamarin.Forms.Build.Tasks.GetTasksAbi" task could not be loaded from the assembly
C:\Users\[MyUser]\.nuget\packages\xamarin.forms\3.0.0.446417\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll.
Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Run Code Online (Sandbox Code Playgroud)
该错误指的是文件Xamarin.Forms.Targets的这个位置:
<XamlGTask
XamlFiles="@(EmbeddedResource)" Condition="'%(Extension)' == '.xaml' AND '$(DefaultLanguageSourceExtension)' == '.cs'"
Language = "$(Language)"
AssemblyName …
Run Code Online (Sandbox Code Playgroud) 我的 UITest 项目适用于原始 Web 服务器,但我想使用WireMock.net将其替换为模拟服务器。我已经在非 UITest 项目中成功使用了它。这是我在 UI 测试项目中的代码:
[SetUp]
public void BeforeEachTest()
{
app = AppInitializer.StartApp(platform);
}
[OneTimeSetUp]
public void InitializerOnce()
{
_mockServer = WireMockServer.Start(new WireMockServerSettings()
{
Urls = new[] { "http://localhost:12345/"},
ReadStaticMappings = true
});
_mockServer.Given(
Request.Create().WithPath("*").UsingAnyMethod())
.RespondWith(Response.Create()
.WithStatusCode(HttpStatusCode.OK).WithBody("Sample response!"));
}
[OneTimeTearDown]
public void DisposeOnce()
{
_mockServer?.Stop();
}
[Test]
public async Task Test()
{
app.Tap(c => c.Marked("MyButton"));
await Task.Delay(5000);
//Assert
Assert.IsTrue(true);
}
private WireMockServer _mockServer;
Run Code Online (Sandbox Code Playgroud)
我的主要 Android 项目有以下代码:
<Button AutomationId="MyButton" Text="Action" Clicked="Action_OnClicked"/>
private async void Action_OnClicked(object …
Run Code Online (Sandbox Code Playgroud)