在OnLaunched期间,在Xamarin.Forms.Forms.Init(e); 应用程序抛出System.IO.FileNotFoundException无法加载文件或程序集'clrcompression,
我有以下依赖项
"Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2",
"Newtonsoft.Json": "9.0.1",
"System.Collections.Immutable": "1.2.0",
"Xamarin.Forms": "2.3.1.114"
Run Code Online (Sandbox Code Playgroud)
所有适用于uwp的xamarin示例应用程序都运行正常.
更新:异常现在已经消失,原因未知.唯一已知的区别是我添加然后删除了xlabs依赖项.我认为这触发了一个破坏的依赖图的重建?!
知道如何调试这个依赖图问题仍然很好.
重现:
下载https://github.com/nventive/Uno.QuickStart
添加名为TestMe的.NETStandard2_0项目.
在MyApp.Droid项目中引用TestMe.
构建MyApp.Droid会带来编译错误:
System.InvalidOperationException:项目TestMe未提供任何元数据引用.这可能是由于路径无效,例如在csproj中使用$(SolutionDir); 尝试使用相对路径.这也可能与缺少的默认配置指令有关.有关更多详细信息,请参阅Uno.SourceGenerator Readme.md文件.at Uno.SourceGeneration.Host.SourceGeneratorHost.d__4.MoveNext()in C:\ projects\uno-sourcegeneration\src\Uno.SourceGenerationHost.Shared\SourceGeneratorHost.cs:line 303 MyApp.Droid
我已经尝试将TestMe.csproj更改为
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
Run Code Online (Sandbox Code Playgroud)
要么
<TargetFrameworks>net47;netstandard2.0</TargetFrameworks>
Run Code Online (Sandbox Code Playgroud)
没有成功.
这个问题有解决方法吗?
请看下面的代码
#include <iostream>
#include <functional>
#include <string>
int main()
{
std::function<void(std::string&)> theFunc;
std::string foo = "0";
theFunc = [](std::string a) { a = "1"; }; // this compiles but has a different function signature
theFunc(foo);
std::cout << "foo should be 1 but is " << foo << std::endl;
theFunc = [](auto a) { a = "2"; }; // this infers the wrong type for auto(by val not by ref), creates the wrong function signature and compiles
theFunc(foo);
std::cout << "foo …Run Code Online (Sandbox Code Playgroud) 我刚读了一本关于javascript的书.作者提到了IEEE 754标准中的浮点算术舍入误差.
例如,添加0.1和0.2会产生0.30000000000000004而不是0.3.
所以(0.1 + 0.2) == 0.3返回false.
我也在c#中重现了这个错误.
所以这些是我的问题是:
这个错误多久发生一次?c#和javascript中的最佳实践解决方法是什么?哪些其他语言有相同的错误?
使用以下项目创建解决方案。
.NetStandard2.0 项目,将其命名为“1”
.NetStandard2.0 项目,将其命名为“2”
在 2 中添加项目 1 的引用
.Net4.6.1 控制台项目将其命名为“3”并添加 nuget Microsoft.CodeAnalysis.CSharp.Workspaces v2.7.0
将以下代码粘贴到项目 3 中
static void Main(string[] args)
{
string dir = Path.Combine(Environment.CurrentDirectory, "..\\..\\..\\");
string solutionPath = Directory.GetFiles(dir, "*.sln").First();
var msWorkspace = MSBuildWorkspace.Create();
Solution solution = msWorkspace.OpenSolutionAsync(solutionPath).Result;
DateTime date = DateTime.UtcNow;
foreach (var project in solution.Projects.Take(2))
{
Compilation compilation = project.GetCompilationAsync().Result;
using (var dllStream = new MemoryStream())
{
var emitResult = compilation.Emit(dllStream);
if (emitResult.Success)
{
Console.WriteLine("Success");
}
else
{
foreach (var err in emitResult.Diagnostics)
{
Console.WriteLine($"{err.ToString()}"); …Run Code Online (Sandbox Code Playgroud) 我有使用“现收现付”模式运行的应用程序洞察力。标准性能指标显示在门户中。自定义指标不会显示在指标部分。
我的环境。运行普通 TCP 套接字的自定义 .NET 核心控制台应用程序。(无 ASP.NET CORE)使用
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.7.2" />
Run Code Online (Sandbox Code Playgroud)
Telemetry 类是使用默认构造函数构造的(并且没有 XML 配置文件)
自定义指标的创建方式如下
Telemetry.Client.GetMetric("number of clients").TrackValue(600.0);
Run Code Online (Sandbox Code Playgroud)
问题:我错过了什么或做错了什么,自定义指标没有显示?azure 门户中的“指标”部分是查找自定义指标的错误位置吗?
更新
示例代码也不会将任何自定义指标上传到 azure。
TelemetryClient client = new TelemetryClient();
client.InstrumentationKey = "a valid key";
client.GetMetric("test me").TrackValue(200);
client.Flush();
Thread.Sleep(5000);
Run Code Online (Sandbox Code Playgroud)