.net-core

DLLImport does not work on Azure App Service Net. 3.1

99封情书 提交于 2021-02-05 08:01:29
问题 I recently added not C# dll to my service a which acts as HTTP Client. On my Local Machine (Windows 10) everything works perfectly. When tried to send a request on Azure i get following response. <h3>There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.</h3> The developer of the dll and I debugged (VS Remote Debug)

DLLImport does not work on Azure App Service Net. 3.1

萝らか妹 提交于 2021-02-05 08:01:26
问题 I recently added not C# dll to my service a which acts as HTTP Client. On my Local Machine (Windows 10) everything works perfectly. When tried to send a request on Azure i get following response. <h3>There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.</h3> The developer of the dll and I debugged (VS Remote Debug)

C# StreamWriter writes extra bytes to the Stream

自作多情 提交于 2021-02-05 07:51:09
问题 var memStream = new MemoryStream(); using (var sw = new StreamWriter(memStream, Encoding.UTF8, 4194304 /* 4 MiB */, leaveOpen: true)) { var str = new string(Enumerable.Repeat(' ', 10240 /* 10 * KiB */).ToArray()); Console.WriteLine(str.Length); Console.WriteLine(Encoding.UTF8.GetBytes(str).Length); sw.Write(str); sw.Flush(); Console.WriteLine(memStream.Length); } // Output // --------- // 10240 // 10240 // 10243 // Output which I was expecting // --------- // 10240 // 10240 // 10240 I checked

Use a Content File from a .NET Standard assembly in a WPF application

删除回忆录丶 提交于 2021-02-05 07:43:37
问题 I want to embed a file in a .NET Standard assembly and use it in XAML in a WPF app. If you set the build action to Resource it is very easy to use the embedded file in other assemblies, but you have to use <Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"> and <UseWPF>true</UseWPF> to be able to use the Resource build action like so: <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> <UseWPF>true</UseWPF> </PropertyGroup> <ItemGroup> <Resource Include="Resources\Image.png" /> <

How to use Dapper to automatically map remaining columns to dictionary?

青春壹個敷衍的年華 提交于 2021-02-05 07:11:25
问题 I am attempting to use Dapper to map to my DTO: public class MyDto { public int Id { get; set; } public string Code { get; set; } public IDictionary<string, object> AdditionalColumns { get; set; } } I can have an instance of MyDto populate the first two properties based on convention, but I'm not sure how to tell Dapper to map all remaining columns into the dictionary. connection.Query<MyDto>("Get_Something", commandType: CommandType.StoredProcedure, param: parameters); The stored procedure

How to use Dapper to automatically map remaining columns to dictionary?

家住魔仙堡 提交于 2021-02-05 07:11:16
问题 I am attempting to use Dapper to map to my DTO: public class MyDto { public int Id { get; set; } public string Code { get; set; } public IDictionary<string, object> AdditionalColumns { get; set; } } I can have an instance of MyDto populate the first two properties based on convention, but I'm not sure how to tell Dapper to map all remaining columns into the dictionary. connection.Query<MyDto>("Get_Something", commandType: CommandType.StoredProcedure, param: parameters); The stored procedure

Entity Framework Core many-to-many navigation issues

社会主义新天地 提交于 2021-02-05 07:09:41
问题 Entity Framework Core has yet to implement many-to-many relationships, as tracked in GitHub issue #1368; however, when I follow the navigation examples in that issue or similar answers here at Stack Overflow, my enumeration fails to yield results. I have a many-to-many relationship between Photos and Tags. After implementing the join table, examples show I should be able to: var tags = photo.PhotoTags.Select(p => p.Tag); While that yields no results, I am able to to load via: var tags =

Entity Framework Core many-to-many navigation issues

你说的曾经没有我的故事 提交于 2021-02-05 07:09:38
问题 Entity Framework Core has yet to implement many-to-many relationships, as tracked in GitHub issue #1368; however, when I follow the navigation examples in that issue or similar answers here at Stack Overflow, my enumeration fails to yield results. I have a many-to-many relationship between Photos and Tags. After implementing the join table, examples show I should be able to: var tags = photo.PhotoTags.Select(p => p.Tag); While that yields no results, I am able to to load via: var tags =

Entity Framework Core many-to-many navigation issues

混江龙づ霸主 提交于 2021-02-05 07:09:23
问题 Entity Framework Core has yet to implement many-to-many relationships, as tracked in GitHub issue #1368; however, when I follow the navigation examples in that issue or similar answers here at Stack Overflow, my enumeration fails to yield results. I have a many-to-many relationship between Photos and Tags. After implementing the join table, examples show I should be able to: var tags = photo.PhotoTags.Select(p => p.Tag); While that yields no results, I am able to to load via: var tags =

Entity Framework Core many-to-many navigation issues

匆匆过客 提交于 2021-02-05 07:09:15
问题 Entity Framework Core has yet to implement many-to-many relationships, as tracked in GitHub issue #1368; however, when I follow the navigation examples in that issue or similar answers here at Stack Overflow, my enumeration fails to yield results. I have a many-to-many relationship between Photos and Tags. After implementing the join table, examples show I should be able to: var tags = photo.PhotoTags.Select(p => p.Tag); While that yields no results, I am able to to load via: var tags =