.net

XUnit - InvalidOperationException : Solution root could not be located using application root

爱⌒轻易说出口 提交于 2021-02-08 06:20:07
问题 I have a Web-API .NET Core 2.2 project and I am trying to do integration tests on it. I have followed the guide from Microsoft. The tests pass when starting them from the test runner and from the command line, they should be configured correctly, I am able to call the controllers via the WebApplicationFactory - HTTP client. I have disabled shadow copy via xunit.runner.json So far so good. I am trying to use Azure DevOps to deploy my project and at the release step, I've added a test step that

What are the strengths of the IAsyncResult pattern? [closed]

送分小仙女□ 提交于 2021-02-08 06:19:38
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I feel that many classes (e.g. TcpClient , UdpClient , HttpListener ) would've been much easier to understand and use if they were

What is the best way to fix “Improper Restriction of xml external entity reference”?

妖精的绣舞 提交于 2021-02-08 06:18:09
问题 We recently run VeraCode that points out on the following method: public XmlElement RunProcedureXmlElement(string Procedure, List<SqlParameter> Parameters) { DataSet ds = RunProcedureDataSet(Procedure, Parameters); XmlDocument xmlDoc = new XmlDocument(); StringBuilder strXML = new StringBuilder(); foreach (DataTable dt in ds.Tables) { foreach (DataRow dr in dt.Rows) { strXML.Append(dr[0]); // Do I still need .ToString()??? } } if (strXML.Length == 0) strXML.Append("<root total=\"0\"></root>")

Can I change the properties of a HttpClientHandler after the HttpClient has been created?

社会主义新天地 提交于 2021-02-08 06:13:24
问题 The HttpClientHandler can be used as a parameter when creating a HttpClient object, but after that there doesn't seem to be any way to access the handler without keeping a reference to it. Dim Handler as New HttpClientHandler Handler.CookieContainer = Cookies Handler.Proxy = Proxy Handler.UseProxy = True Handler.AutomaticDecompression = DecompressionMethods.GZip Or DecompressionMethods.Deflate Dim Client as New HttpClient(Handler, True) Am I able to change the properties of a handler of an

Mouse not working with Monogame in Winforms

十年热恋 提交于 2021-02-08 06:11:09
问题 I've embedded Monogame into a Windows Form using this code: private IntPtr drawSurface; private Control gameForm; public MapEditor(MainWindow window) { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; this.drawSurface = window.pcbViewport.Handle; graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings); Mouse.WindowHandle = drawSurface; gameForm = Control.FromHandle(this.Window.Handle); gameForm

Mouse not working with Monogame in Winforms

血红的双手。 提交于 2021-02-08 06:10:46
问题 I've embedded Monogame into a Windows Form using this code: private IntPtr drawSurface; private Control gameForm; public MapEditor(MainWindow window) { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; this.drawSurface = window.pcbViewport.Handle; graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings); Mouse.WindowHandle = drawSurface; gameForm = Control.FromHandle(this.Window.Handle); gameForm

C# - XML - Compression

谁说我不能喝 提交于 2021-02-08 06:04:58
问题 I have a situation where I am generating a XML file to be submitted to a webservice, sometimes due to the amount of data it exceeds 30mb or 50mb. I need to compress the file, using c#, .net framework 4.0, rather one of the nodes which has most of the data.. I have no idea how i am going to do it .. is it possible if someone can give me a example of how I can get this done please. the xml file looks like this <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <HeaderTalk xmlns="http://www

QueryableCollectionView with datagrid and dataform - selection changed issue

久未见 提交于 2021-02-08 05:41:50
问题 I have an mvvm solution. In my viewModel I have an QueryableCollectionView of the class BaseClass objects and an standalone BaseClass element(let's call it seletedElem). The BaseClass have a private QueryableCollection of the ChildClass objects - SCollection , and a property that returns this collection. Both classes are implementing the following interfaces: INotifyPropertyChanged , IDataErrorInfo , IEditableObject . In my view I have raddatagrid which itemssource is binded to the

QueryableCollectionView with datagrid and dataform - selection changed issue

本小妞迷上赌 提交于 2021-02-08 05:41:23
问题 I have an mvvm solution. In my viewModel I have an QueryableCollectionView of the class BaseClass objects and an standalone BaseClass element(let's call it seletedElem). The BaseClass have a private QueryableCollection of the ChildClass objects - SCollection , and a property that returns this collection. Both classes are implementing the following interfaces: INotifyPropertyChanged , IDataErrorInfo , IEditableObject . In my view I have raddatagrid which itemssource is binded to the

Convert KeyDerivation.Pbkdf2 in .Net 4.5.1 to .Net 4.0

倖福魔咒の 提交于 2021-02-08 05:33:06
问题 I have two project which using .net 4.0 and .net 4.6.1, the KeyDerivation only available after .net 4.5.1. How can I get the same hash result in .Net 4.0 using other hash library such as Rfc2898DeriveBytes/ Crypto byte[] salt = new byte[128 / 8]; var hashedPassword = Convert.ToBase64String(KeyDerivation.Pbkdf2( password: "GN(o@D30", salt: salt, prf: KeyDerivationPrf.HMACSHA512, iterationCount: 100000, numBytesRequested: 256 / 8) ); 回答1: Problem with Rfc2898DeriveBytes is that it only supports