.net-core

Do you have to have .net core installed on a system before using self contained apps?

自古美人都是妖i 提交于 2021-02-05 09:38:47
问题 I'm using Visual Studio 2019 to publish a self contained .net core 2.1 app. Many files are emitted during the publishing (application files as well as core libraries). But there is no dotnet.exe included in the published files. Without a dotnet.exe I can't launch the published app! So I'm confused. Must you have a system wide .net core installed to use self-contained apps, and if so, then you're app certainly isn't self contained. 回答1: A self-contained app will contain everything needed to

How to get private key as Byte[] of a password protected pfx fetched from azure key vault

旧时模样 提交于 2021-02-05 09:33:11
问题 I am fetching my certificate from Azure Key Vault using GetSecretAsync() method and then I am expecting to get the byte[] of the private key and the certificate eventually. I have my application in .netcore3.1 This is how my code looks like : var certWithPrivateKey = Client.GetSecretAsync(ConfigurationSettings.AppSettings["AKVEndpoint"], ConfigurationSettings.AppSettings["CertName"]).GetAwaiter().GetResult(); var privateKeyBytes = Convert.FromBase64String(certWithPrivateKey.Value);

EF Core Query Many to Many with filtering

∥☆過路亽.° 提交于 2021-02-05 09:31:30
问题 I have the following table structure: I want to retrieve all funds for provided reportId . I did it this way: var result = _context.FundsInReports .Join(_context.Funds, a=> a.FundId, b => b.Id, (fir, fund) => new {fir, fund}) .Join(_context.Reports, a=> a.fir.ReportId, b=> b.Id, (fir2, report) => new { fir2, report}) .Where(q=> q.fir2.fir.ReportId==reportId) .Select(res => new FundsResponse() { FundId = res.fir2.fund.Id, LegalName = res.fir2.fund.LegalName, HeaderName = res.fir2.fund

Exclude an enum property of a Model from using the JsonStringEnumConverter which is globally set at the Startup?

自闭症网瘾萝莉.ら 提交于 2021-02-05 09:02:00
问题 I am developing the ASP.NET Core Application using the latest .NET Core 3.1.1 and System.Text.Json which was previously using the Newtonsoft.Json . As recommended in the Microsoft Migration guide I have done the changes. Also, as most of my enums need to be serialized as String I have configured my Startup.cs ConfigureServices to use the JsonStringEnumConverter globally. public void ConfigureServices(IServiceCollection services) { // lines omitted for brevity services.AddControllers()

Exclude an enum property of a Model from using the JsonStringEnumConverter which is globally set at the Startup?

半世苍凉 提交于 2021-02-05 09:01:32
问题 I am developing the ASP.NET Core Application using the latest .NET Core 3.1.1 and System.Text.Json which was previously using the Newtonsoft.Json . As recommended in the Microsoft Migration guide I have done the changes. Also, as most of my enums need to be serialized as String I have configured my Startup.cs ConfigureServices to use the JsonStringEnumConverter globally. public void ConfigureServices(IServiceCollection services) { // lines omitted for brevity services.AddControllers()

powershell core error: The specified module 'RPC-Client' was not loaded

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-05 08:53:09
问题 How do I find out more information about xml-rpc for powershell ? PS /home/nicholas> PS /home/nicholas> Update-Help PS /home/nicholas> PS /home/nicholas> Get-Help Send-XmlRpcRequest Get-Help: Get-Help could not find Send-XmlRpcRequest in a help file in this session. To download updated help topics type: "Update-Help". To get help online, search for the help topic in the TechNet library at https://go.microsoft.com/fwlink/?LinkID=107116. PS /home/nicholas> PS /home/nicholas> Get-Host | Select

powershell core error: The specified module 'RPC-Client' was not loaded

╄→尐↘猪︶ㄣ 提交于 2021-02-05 08:53:05
问题 How do I find out more information about xml-rpc for powershell ? PS /home/nicholas> PS /home/nicholas> Update-Help PS /home/nicholas> PS /home/nicholas> Get-Help Send-XmlRpcRequest Get-Help: Get-Help could not find Send-XmlRpcRequest in a help file in this session. To download updated help topics type: "Update-Help". To get help online, search for the help topic in the TechNet library at https://go.microsoft.com/fwlink/?LinkID=107116. PS /home/nicholas> PS /home/nicholas> Get-Host | Select

Is there some workaround I can use to avoid mixed-content errors?

眉间皱痕 提交于 2021-02-05 08:50:07
问题 I am working on a .Net core web app which is using esri services /resources. The app will eventually be hosted on the client's server. We have esri resources hosted on our servers and other esri resources hosted on their servers. For whatever reason, they refuse to use SSL and we do use SSL so I now have an Mixed content: The page at https://app.smt.smt was loaded over HTTPS but requests and insecure XMLHttpRequest endpoint. This request has been blocked; the content must be served over HTTPS

DateTime precision in .NET core

£可爱£侵袭症+ 提交于 2021-02-05 08:20:10
问题 Following Eric Lippert's post years back on precision of DateTime , I ran his test on .netcore and .NET Framework 4.5.2, on the same machine with Windows 10. var n = 1000; int i = 0; long[] diffs = new long[n]; while (i++ < n-1) { if (ticks != DateTime.Now.Ticks) { var newTicks = DateTime.UtcNow.Ticks; var diff = newTicks - ticks; diffs[i] = diff; ticks = newTicks; } } foreach (var d in diffs) { if (d == 0) Console.WriteLine("same"); else Console.WriteLine(d); } The result on .NET framework 4

DateTime precision in .NET core

丶灬走出姿态 提交于 2021-02-05 08:20:01
问题 Following Eric Lippert's post years back on precision of DateTime , I ran his test on .netcore and .NET Framework 4.5.2, on the same machine with Windows 10. var n = 1000; int i = 0; long[] diffs = new long[n]; while (i++ < n-1) { if (ticks != DateTime.Now.Ticks) { var newTicks = DateTime.UtcNow.Ticks; var diff = newTicks - ticks; diffs[i] = diff; ticks = newTicks; } } foreach (var d in diffs) { if (d == 0) Console.WriteLine("same"); else Console.WriteLine(d); } The result on .NET framework 4