There was a very strange pit last week , First, I wrote two programs , The first program outputs dll, The second program is the console program .

In the first program , I use the process To start the second program , At the same time, a Json As a parameter , namely :

Process.Start(program2.exe, Jsonpara);

This Jsonpara Is the one List<List<string>> Is converted to string type .

As a result, when I was excited to wait for the moment of the program , The console reported an error ,Newtonsoft.Json.reader Balabala is wrong ...

That is to say, program 2 can't deserialize the string to List<List<string>>, So the string is wrong .

The screening process :

1) Program two Debugging of parameters transferred from the console , No mistake ...

2) Procedure one check Json Is it right , No mistake ...

3) Program 2: the console outputs the incoming parameters , There is a mistake !!!

reason :Json take quotes It's escaped ... Of course, your debugging in program one is shown correctly , It just changes when the console receives it !!!

solve : For the stability of the program , Direct transmission of Json Write a txt In the file , Then the console program reads the file .

notes : If you modify the escaped parameters in the console and read them correctly , Or modify it in program one json Parameters , Make it the correct parameter after escaping , I feel that the gain is not worth the loss , It's not convenient to write and read files yet .

C# Basics - About use json To the console program to pass the value of the pit of more related articles

  1. C# The creation of the basic console program , Output , Input , Defining variables , Variable assignment , Value override , Value stitching , Value printing

    The basic learning contents are Console.WriteLine(" What to output ");// What's going on out there is Console.ReadLine(); // Waiting for user input , Press enter to finish , Prevent the program from flashing back control ...

  2. NET Core The console program reads appsettings.json 、 It depends on 、 Distribution log 、 set up IOptions

    .NET Core The console program doesn't have ASP.NET Core Of IWebHostBuilder And Startup.cs , That's to read appsettings.json. It depends on . Distribution log . set up IOptio ...

  3. 2017-2-17 c# Based on learning ( The creation of the console program , Output , Input , Defining variables , Variable assignment , Value override , Value stitching , Value printing )

    1 The creation of the console program > New projects   , choice c#,  Frame selection 4.0 , Select control application , Choose where to save the file Change the name . 2 c# Output and input > stay main Function to write code > Editing ...

  4. .Net Core Console program error :Can not find runtime target for framework &#39;.NETCoreApp,Version=v1.0&#39; compatible with one of the target runtimes: &#39;win10-x64, win81-x64, win8-x64, win7-x64&#39;.

    .Net Core Console program error :Can not find runtime target for framework '.NETCoreApp,Version=v1.0' compatible wi ...

  5. svc6 The console program uses SoapToolkit3.0 call WebService

    1. First install SoapToolkit3.0 Install the package and install ( My installation directory is :C:\Program Files\Common Files) 2. newly build vc Console program ( Empty item ), Project name :WinConsol ...

  6. SpringMVC Basic introduction , Create a HelloWorld Program

    ref:http://www.admin10000.com/document/6436.html One .SpringMVC Basic introduction , Create a HelloWorld Program 1. First , Import SpringMVC need ...

  7. Use VSCode How to debug C# Console program _1

    A- Environmental installation https://www.microsoft.com/net/download download .NET Core SDK Installer: https://www.microsoft.com/ ...

  8. VS Hollow project 、win32 project 、 The difference between console programs ( turn )

    Empty item , Most want to simply create c++ New students in Engineering , open vs You probably don't know what project to choose to create , Please believe me at this time , Empty project is your best choice . Because the empty project does not contain any source code files , Next, you just need to write in the corresponding source code folder and header file ...

  9. C# One of the basic courses notes and console 、 Some common sense

    A comment is a programmer's description of the code , To make the program readable . Source code in the process of compiling , The compiler ignores its comments . () Line notes The format is :// The comment Use two slashes to indicate the beginning of the comment , Until the end of the line, the comment ends . () Block annotation ...

Random recommendation

  1. dtw Algorithm

                              dtw Path versus linear transformation path from :http://baike.baidu.com/link?url=z4gFUEplOyqpgboea6My0mZP ...

  2. createDocumentFragment

    http://www.cnblogs.com/myjavascript/p/3708920.html For the loop batch operation page DOM It helps a lot ! Using document fragmentation , And then one time append, And use native j ...

  3. kettle stay linux start-up spoon.sh Report errors

    org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]     at org.eclipse.swt.SWT.error ...

  4. Strongly connected branches of a digraph Tarjan Algorithm explanation + HDU 1269 Connected graph Tarjan The final report

    The title is very simple. Let's talk about it briefly   Strongly connected branches of a digraph Tarjan Algorithm Strongly connected branches of a digraph Tarjan The algorithm pseudo code is as follows :void Tarjan(u) {dfn[u]=low[u]=++index// Conduct DF ...

  5. Spring Study (11)---JSR-250 Standard notes of @Resource、@PostConstruct、@PreDestroy

    1)@Resource(JSR-250 Standard notes , It is recommended to use it instead of Spring Proprietary @Autowired annotation ) Spring Not only support your own definition @Autowired annotation , It also supports several JSR-250 It's the norm ...

  6. Sharp motion video SDK In the financial business encryption double record management system general solution

    In order to better protect the legitimate rights and interests of consumers , The China Banking Regulatory Commission and the China Insurance Regulatory Commission have put forward requirements , At the bank . When insurance practitioners sell financial products or sell products on behalf of other institutions , Recording and video recording at the same time , Make sure the sales people follow the procedure . Introduce products according to regulations , So that buyers can have a better understanding of the product's safety ...

  7. Java Basics -- Collection and Iterator Interface implementation

    Collection Is to describe all sequence containers ( aggregate ) Common root interfaces , It may be thought of as a “ Auxiliary interface ”, That is, the interface that appears because it represents the commonness of several other interfaces . in addition ,java.util.AbstractCollection ...

  8. C#----- Thread safe ConcurrentQueue&lt;T&gt; queue

     ConcurrentQueue<T> Queue is an efficient thread safe queue , yes .Net Framework 4.0,System.Collections.Concurrent A data in the namespace ...

  9. Summary of recent interview (Android)

    Summary of recent interviews (2018 In the second half of ) Some of them are platitudes, some of them are not met . 1.HTTP and HTTPS The difference between HTTP The data transmitted by the protocol is unencrypted , That's the plaintext , Therefore use HTTP Protocol transmission of private information is very insecure , by ...

  10. Oracle Cursor Usage Summary

    cursor Divided into three , One is to state directly that cursor Variable , The second is to declare the type first and then the variable , The third is to declare that sys_refcursor. (1) Make a direct statement declare cursor emp_cur  is sele ...