Unknown: The object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8) When creating a new website and using umbraco

Solution which worked for me was

1. Remove the website which shows this error .

2. Now open command prompt

3. Goto C:\Windows\Microsoft.NET\Framework64\v4.0.30319> and run this command aspnet_regiis.exe -i ( If it gives some administrator rights error then you will have restart command prompt with run as administrator option.)

4. After installation is finished , try again adding a new website and run the umbraco after copying the code in that website .