C # Create a site fails to start and stop the problem

This problem depressed for nearly a day. This two-day writing Web site installation, on-line to find relevant code has a lot to create a site.

Depressed question here is: Once you create a site with DirectoryEntry, you can delete the response, but can not stop and start.

When a stop and start commands, the newspaper "service did not respond to the start or control request" error.

 

I juggle, mutatis mutandis parameters, because only problem with the code is created, and the new manual is normal. So the above report errors simply can not solve the problem.

 

Or into the topic. The ultimate question is positioned on the site ID.

My ID is a start date hours of positioning:

private string websiteID = DateTime.Now.ToString("yyyyMMddHHmm"));

Later, the provincial point becomes shorter, as follows:

private string websiteID = DateTime.Now.ToString("MMddHHmmss"));

 

This ID is created and find and delete commands can be a normal response, that I have not been focused on targeting the problem here.

 Here that question:

The first one was too long, beyond the size of an int.

Second, depressed, and now just in January, so the numbers that start with 01, so. . It does not work.

Finally, turn to plastic surgery, everything is normal.

private string websiteID = int.Parse(DateTime.Now.ToString("MMddHHmmss")).ToString();

 

So, brush the day passed.

to this end. It compared the parameters, metabase.xml than right. A decrease tried a parameter, a parameter a plus tried. Unexpected problem also search the search.

Turned out to be such a big Internet, I should have failed encounter a problem.

Later, at a period, casually about the implementation of projects, turned out to be normal, so step by step debugging, in order to compare parameters did not finish particularly when, suddenly feeling to see in front of a ID number is 0 questions that may arise .

Ugh. . Well this too. . . .

Reproduced in: https: //my.oschina.net/secyaher/blog/274177

Guess you like

Origin blog.csdn.net/weixin_34357962/article/details/91966890