Can not say that all the bugs are paper tigers, but often the kind of seemingly wonderful bugs, the cause is really simple, annoying you for a period of time, to find the truth and let you can't help a smile. What is a wonderful bug? My definition is: The code logic is the same, but at a is good, to B is not good or the same kind of ABC is OK, D but not the bug. In the end, the problem is really not on the code logic, it is often outside the configuration, permissions, or business logic.
Local is OK, server or not, blame me
CASE1: Local engineering changed, knocked down the server, but a while, test sister again called, "or not, you look again." Suddenly wrinkly, how can, oneself again run again, is duly completed AH. Then push it down on the server and run it again, OK. Only ccnet Continuous integration compilation cannot pass. Scratching thought for a long day. found that the debug version was just running, and CCNet ran to the release version. And it is because debug wrote some configuration, release is not written so wrong.
Summary: Do not be busy from the beginning of the wrong, except Debug,release. Git also has master,release,prelease,newfunction and many more versions. If this is wrong, it could lead to bigger problems.
CASE2: In accordance with customer needs to change the function, put on the cloud server, I will be on the local IIS release confirmation. But one time suddenly found every visit to login authentication. Just like:
Obviously is set up can be anonymous access, also gave Iusr_xxxx, everone, various permissions, but is not. What is the difference between a local IIS7 and a IIS6 on the server? But other sites in the same directory are OK. I follow the normal site configuration, also no, re-deployment is not resolved. Then a variety of searching, various look at the post, I am sure it is related to the authority, perhaps a file, perhaps the configuration of Webconfig, but tried to find or invalid. In the middle of the midnight, silently and the screen, the window, the autumn wind at first, the room, roommate has been asleep.
Suddenly a bright, there is a blog that may be iusr_xxx account does not have AD permissions, in the place of anonymous users need to set up a privileged account. I changed into a xxxx/adminstrator, and sure enough. But why is this, other sites anonymous user is iusr_xxx OK, this will not have any problem. The phenomenon is solved, but the real problem is not found, perhaps a program, perhaps a file. We have to follow up.
Summary: On the surface of similar individuals, or have their own differences. But this problem only solves the phenomenon, does not solve the essence.
CASE3: This question really is a wonderful work, colleague asked me, he webservice can't call. Morning also good, in the afternoon reported 407 agent error. But it is the old saying: " my other services can be called Ah, in other computers can also call, on this computer suddenly die", I and he measured to go, the API itself is not a problem, the network is not a problem, the computer no problem, the code is not a problem, because it did not come in. Where's the problem? Then his wife (yes, he sat with his wife) accidentally opened the App. config in vs. Then the file appears to be automatically modified, and then the program will pass. Similar problems I have encountered, I have a program is to use the Xdocument.save method each time to overwrite a file, but always did not successfully overwrite, even if the VS prompt: "The file has been modified, whether to reload the current file" I am sure, still did not change, but I deleted the contents of the file. But can be successfully overwritten. Then the colleague suggested that I replace the File.writealltext method, just fine.
Summary: Have you encountered the XML file has not been successfully modified. Or are frequently changing files not suitable for XML persistence?
EF jokes.
The thing is, in order for the content to be better displayed in the table, I intercepted the content longer, but found that the use of the place has been changed, but the database has not changed.
foreach (var in notes) { var str = commonhelper.striphtml (note. Content); if the ) { = str. Substring (0" ... " ; } }
But not saved. But when one is fished out, the content changes.
Raw = _respository. Getnotebyid (ID);
But the database hasn't changed.
Then restart, first access to the editing page, the data is normal, obviously affected by the previous method. Is the data cached? Later found that, because clever to make a single case, the warehouse inside the Db=xxdb.getinstance (). As a result, both pages are a context. The data is cached and the object that caused the query is not from the database. If you save this time, other shortened content will be saved to the database. And the simplest way is to db=new dbcontext ();
Summary: This is purely a problem that you do not understand the EF mechanism, which is self-defeating.
CKEditor is not obedient.
Colleagues do a function, asynchronous loading an edit box, found that sometimes can be loaded successfully, at times not. Some pages have been able to, and some pages have not.
<class= "" name= "Content" id= "Content" >
Ckeditor.replace (' Content ', { toolbar: ... });
In fact, for the ckeditor,replace after the parameter ID can also, name can also. But when he found that the two parameters were different and changed to the same, they all loaded successfully. There may be some interference in the page.
There are some "magical phenomena", can not tell the story, also do not mention. But often these bugs will cost us a lot of time. Most of the problems that can be found are solved. Can't find the cause of the problem, is not a problem to solve. Sometimes even if the phenomenon is solved, but does not necessarily solve the cause of the problem, so I am accustomed to these things are recorded, appear once, may appear a second time. This article is dedicated to the fragments of our bug-fixing time.
"The end of the month"---those wonderful bugs