Hi,
getting below error in catch : SPSite site = new SPSite(siteurl); line
The Web application at https://xxx-sp-pcc.cloudapp.net/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

Junaid MuslaRank #8,429 · 222 reputationPosted Oct 7, 2020, 1:32 AM EDT
Found this reference:
https://www.c-sharpcorner.com/blogs/how-to-solve-error-while-creating-spsite-object-in-sharepoint1
Hope it helps!
Satyajit PaulRank #526 · 4.6K reputationPosted Oct 8, 2020, 9:10 PM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Oct 8, 2020, 9:54 PM EDT
- account is a member of WSS_ADMIN_WPG
- If it is already so then
- Go to Project Properties
- Build Tab
- Change the Platform Target value to
also try to open VS in administrator mode.Any CPUfrom the drop down.Mageshwaran RRank #411 · 6.1K reputationPosted Oct 9, 2020, 5:04 AM EDT