.net

How can I accept arbitrary JSON objects in my REST WCF service?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 06:15:10
问题 I want to implement a service method like this: [OperationContract] [WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json)] public void MakeShape(string shape, string color, IDictionary<string, object> moreArgs) { if (shape == "circle") { MakeCircle(color, moreArgs); } } My clients POST objects like: { "shape":"circle", "color": "blue", "radius": 42, "filled":true, "annotation": {"date":"1/1/2012", "owner":"George"} } At the call to MakeCircle, moreArgs would

.NET MSI Install project - Overwrite previous version

北战南征 提交于 2021-02-07 06:01:06
问题 I have an MSI installer project that installs a windows service. My version numbering method is best described by this post: What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion? I am not changing the Version of my install project as that is not changing, and I've had too many issues when doing that. I have already installed my service with the following assembly versions [assembly: AssemblyVersion("4.3")] [assembly: AssemblyFileVersion("4.3.0.0")

RestSharp error when shared as a dependency and different publicKeyTokens

不羁岁月 提交于 2021-02-07 05:33:00
问题 Using APIs from Docusign , Twilio and Auth0 . All 3 have RestSharp.dll as a dependency. If I use the RestSharp.dll included with the Docusign package, Docusign works well but Auth0 and Twillio give errors: Could not load file or assembly 'RestSharp, Version=104.1.0.0, Culture=neutral, PublicKeyToken=null' If I use the normal RestSharp.dll (Install-Package RestSharp), Twilio and Auth0 work fine but I get an error when using Docusign: Could not load file or assembly 'RestSharp, Version=100.0.0

Is there any way to save an XmlDocument *without* indentation and line returns?

≡放荡痞女 提交于 2021-02-07 05:19:17
问题 All my searches have brought up people asking the opposite, but I have a file which grows by nearly 50% if it is saved with line returns and indentation. Is there any way round this? EDIT I'm not talking about opening a file, but saving one. This code reproduces the 'bug' for me: var path = @"C:\test.xml"; System.IO.File.WriteAllText(path, "<root>\r\n\t<line></line>\r\n\t<line></line>\r\n</root>"); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.PreserveWhitespace = false; doc

Is there any way to save an XmlDocument *without* indentation and line returns?

佐手、 提交于 2021-02-07 05:16:17
问题 All my searches have brought up people asking the opposite, but I have a file which grows by nearly 50% if it is saved with line returns and indentation. Is there any way round this? EDIT I'm not talking about opening a file, but saving one. This code reproduces the 'bug' for me: var path = @"C:\test.xml"; System.IO.File.WriteAllText(path, "<root>\r\n\t<line></line>\r\n\t<line></line>\r\n</root>"); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.PreserveWhitespace = false; doc

Is there any way to save an XmlDocument *without* indentation and line returns?

柔情痞子 提交于 2021-02-07 05:16:04
问题 All my searches have brought up people asking the opposite, but I have a file which grows by nearly 50% if it is saved with line returns and indentation. Is there any way round this? EDIT I'm not talking about opening a file, but saving one. This code reproduces the 'bug' for me: var path = @"C:\test.xml"; System.IO.File.WriteAllText(path, "<root>\r\n\t<line></line>\r\n\t<line></line>\r\n</root>"); System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); doc.PreserveWhitespace = false; doc

SSH.NET - No suitable authentication method found

陌路散爱 提交于 2021-02-07 05:12:01
问题 This is my code using SSH.NET using (var sftp = new SftpClient(host, username, password)) { sftp.Connect(); } It works on a SFTP I installed on my local computer but when I point it at a real SFTP server from a client I get a Renci.SshNet.Common.SshAuthenticationException: No suitable authentication method found to complete authentication. I cannot find any documentation on what authentication methods I should be using and on File Zilla a simple user name and password is doing the trick. Can

SSH.NET - No suitable authentication method found

烂漫一生 提交于 2021-02-07 05:11:34
问题 This is my code using SSH.NET using (var sftp = new SftpClient(host, username, password)) { sftp.Connect(); } It works on a SFTP I installed on my local computer but when I point it at a real SFTP server from a client I get a Renci.SshNet.Common.SshAuthenticationException: No suitable authentication method found to complete authentication. I cannot find any documentation on what authentication methods I should be using and on File Zilla a simple user name and password is doing the trick. Can

SSH.NET - No suitable authentication method found

℡╲_俬逩灬. 提交于 2021-02-07 05:11:15
问题 This is my code using SSH.NET using (var sftp = new SftpClient(host, username, password)) { sftp.Connect(); } It works on a SFTP I installed on my local computer but when I point it at a real SFTP server from a client I get a Renci.SshNet.Common.SshAuthenticationException: No suitable authentication method found to complete authentication. I cannot find any documentation on what authentication methods I should be using and on File Zilla a simple user name and password is doing the trick. Can

C# Linq: Combine multiple .Where() with an *OR* clause

北战南征 提交于 2021-02-07 04:54:10
问题 I have been searching a lot about my current problem but I could not find a real answer to solve that issue. I am trying to build a LINQ Query that produces the following SQL: SELECT * FROM TABLE WHERE (Field1 = X, Field2 = Y ... ) or (Field3 = Z) In a normal situation I would just do this: Object.Where(c => (c.Field1 == X && c.Field2 == Y) || (c.Field3 == Z)) I cannot use this approach because the query is build by using multiple .Where() calls. Having an example: // This is a short example,