Google Authtication is raising the following :- OpenID auth request contains an unregistered domain: - asp.net-mvc-5

I have created asp.net mvc5 web project, I have enabled Google Authtication by un-commenting the following inside the Startup.Auth.CS:-
app.UseGoogleAuthentication();
now I have create a project on the following environment:-
Visual studio 2012 professional.
Asp.net mvc5 web application.
Running on windows server 2008 R2.
And the Google authentication works well on my test project runs locally http://localhost:53357.
Yesterday I wanted to test the new Visual Studio 2013, so I download Visual Studio 2013 express on my windows 7 machine,, and I created a new asp.net mvc5 web project. But when I try to test the Google authentication I got the following error on google page:-
> 400. That’s an error.
>
>
>
> OpenID auth request contains an unregistered domain:
> http://localhost:53682
>
>
>
> Learn more
>
> That’s all we know.
So why google authentication works well on certain projects and fail to work on other?
Please adivce

Google has stopped registering new domains from may 2014 onwards. This applies to all those using OPEN ID. https://developers.google.com/accounts/docs/OpenID2

The solution to this problem is to use Google Plus which is doable within the current OAuth classes provided by Asp.Net MVC as outlined in this article.
I followed his instructions and it is working fine.
EDIT: I will point out that the link in his article to set up the Google end of things takes you one level too deep. When you hit the Google Developers Console, click on Projects in the upper left of the screen to go back up a level and create your project first before proceeding. You will need to complete the Consent screen and Credentials screen to get it to work.

Related

Unable to open the Web site 'http://localhost/XYZ'. Some of the properties associated with the solution could not be read

I copied a web application to my local development machine. When I open the solution in Visual Studio 2019, I get the following error:
Unable to open the Web site 'http://localhost/XYZ'. The Web site 'http://localhost/XYZ' does not
exist. Some of the properties associated with the solution could not be read.
I found this similar question and answer:
The Web site {site name} does not exist
But the directory that is indicated in the error message is different. My error is specifically targeting "http://localhost/...". I've been developing with Visual Studio for several years and I've worked with IIS a little - configuring application pools and converting directories to websites - but that's about it. Any idea what I'm missing here?
You can try the following steps to solve your problem:
Click Start, and then click Control Panel.
Click Programs and Features.
Click Turn Windows features on or off.
In the dialog box, expand Internet Information Services.
Expand Web Management Tools, and then expand IIS 6 Management
Compatibility.
Click to select the IIS Metabase and IIS 6 configuration
compatibility check box, and then click OK.

Visual Studio 2013 Asp.net Razor v3 website unable to host to IIS windows 7.5

I am trying to host a asp.net razor v3 website to IIS, but it is not working. I tried multiple options including first creating the website then publishing to IIS, or directly creating a new website under IIS using visual studio 2013. It gives me HTTP Error 503. The service is unavailable.
Methods to reproduce Error:
Option 1
1) Create a new asp.net web site (razor v3) in visual 2013, and click publish to publish to a directory. Then, add that directory as a website in IIS.
Option 2
1) On the new website window, in visual studio 2013, go to browse and select IIS, and create a virtual directory directory under IIS to save the site.
Then, go to the browser and try to access the hosted site: localhost/sitename, it always produces some kind of errors. Like 503. What am I missing? Please help, looks like I am missing some steps or some configuration changes.
Also, I am trying this with the default razor v3 webiste content and without modifying anything. So, I have not touched any files or anything, I am just trying to upload to IIS.
The correct answer I found was that for some reason you must use the IIS Express 8.5 to test/host that site.
Even the installations on the fresh copies of Windows with Full IIS prior to version 8 did not work on my test machines.

HTTP Error 404.17 - Not Found (.Net 4)

I've just got a new server setup on Windows 2008 Web edition. I'm trying to set the first asp.net 4 application up on it but am having nothing but problems.
The latest is that I'm getting the 404.17 error, which says "the requested content appears to be script and will not be served by the static file handler.".
I've done a lot of research on google but most suggestions seem to be to run aspnet_regiis -i to install asp.net 4. I've done this several times both on the Framework and Framework64 folders, but with no success.
I tried changing from the default application pool to a .net4 application pool, which appeared to work at first and I instead got a server error to do with permissions. I fixed that, and immediately the 404.17 error returned.
Other suggestions I've read say to go into the "turn windows features on and off" and make sure .net 4 is selected there under IIS. However on this server clicking "turn windows features on and off" takes me to the standard windows 2008 server manager. I click "add features" there, and only ".NET Framework 3.0 Features (Installed)" is listed and selected. .NET 4 isn't shown there, yet it is selectable through the application pools.
What else can I try to get the website running as I'm at a complete loss now. Its annoying because my old server was easy to manage - I did it all through the server itself without a control panel (Windows 2003), now on my new server I have to manage most of it through Plesk because there is no dns.
Any help would be much appreciated.
I too had the same problem but solved it with simple solution. My program was in framework 4.0 but in application pool was mapped to framework 2.0.
Just changed the frame work in application pool to 4.0.
It worked.
I've finally figured out the problem, and it was to do with Plesk itself.
After delving through some of the thousands of links throughout the plesk control panel I found a page for "Website Scripting and Security". Under there it was set to .NET 2.0. However, even though I'd installed .NET 4 on the server, Plesk didn't know about it. Although the application pool I'd set the website to run under through IIS was .NET 4, it still wouldn't work for some reason.
I then found another page under "tools and settings" for server components, and on that page is a refresh button. Hit that and it suddenly realised that .NET 4 was installed, went back to the website scripting and security page, selected .NET 4, and hey presto, I got a server error (never have I been so glad to see a server error).
I then just had to give the application pool identity read access to the web folder, and the website worked.
I wish I'd paid an extra £15 per month for Windows 2008 Standard edition now so I could manage it all manually without Plesk.
Ensure that you are running this application under a Virtual Directory, also ensure that your IIS has ASP, ASP.Net, ISAPI Extensions And Filters, Static Content installed.
Change the .net framework from 'plesk' panel:
go to Domains
select then domain
Go to 'Domain and Websites & Domains'
Hide Advanced Operations
Go to 'Asp.net Settings'
Go to 'Change Version'
select 4.0
If you don't have the 4.0 option then you must install the framework on your server first.

Debugging Azure: Error attaching the debugger to the IIS worker process

I have a web application asp.net to deploy to Windows Azure. I try to run it on local first. But when debugging, I catch this error from VS2010:
"There was an error attaching the debugger to the IIS worker process
for URL 'http://127.255.0.0:82/' for role instance
'deployment16(6).WindowsAzureProject2.WebApplication3_IN_0'.
Unable to start debugging on the web server ......."
I've search so hard to find the solution for this problem but there's nothing seems work for me. I'm a newbie in Windows Azure, it's really a big trouble with me.
I had similar problem with Windows 8, debuging a cloud application with Visual Studio 2012 RTM and Azure SDK 1.71, when trying to launch the application into the compute emulator. It was a very simple app, but I used Azure diagnostics. At the end these are two things I have changed that have work for me, both turning on Windows 8 features (so go to Win8 and open 'Turn Windows Features On/Off'.
Activate the checkboxes for:
Internet Information Services Hostable Web Core
Internet Information Services > World Wide Web Services > Application Development Features > ASP.NET 4.5
Internet Information Services > World Wide Web Services > Health and Diagnostics > Tracing
Internet Information Services > Web Management Tools > IIS Management Scripts and Tools
That worked for me, it makes sense, as I'm using Visual Studio 2012 and trying to get some trace information using diagnostics in Azure.
I hope this will work for you or give some tip about the problem. In the case of being useful information, remember to vote as response or as value tip.
Thanks,
Mike
This usually happens when there's a problem with the project to be deployed to the emulator (WindowsAzureProject2 in your case).
Try the following:
Check %UserProfile%\AppData\Local\dftmp\IISConfiguratorLogs\IISConfigurator.log file for the error messages. See more details in this answer.
Make sure your project can be started without the emulator. It's a web project, so just try to start it as a regular web project. Or publish it to the separate folder and try to create a website in IIS of it.
Check your *.csdef and *.cscfg files to make sure all the configuration is correct.
Make sure that the build output of your project is not empty. You can do this by going to IIS, find the site with the name similar to deployment16(6).WindowsAzureProject2.WebApplication3_IN_0, right click --> Explore.... Make sure that this folder is not empty and contains all the files required to start a web project successfully.
BTW, there's a similar question: Debugger can't connect when starting local azure project
Follow step 11 from http://www.microsoft.com/en-us/download/details.aspx?id=35448. Worked for me on Windows 8 with Oct 2012 SDk
I just have today the same problem trying to Debug locally with Azure Storage Emulator in Windows 7. So in the Azure project properties, in Web tab, I checked the radio button 'Use IIS Express' and it debugged without problem. I hope this helps someone.
I encountered this exact same problem when I upgraded an existing Azure solution to the Azure SDK 2.1. After some hunting around I uncovered that the upgrade had automatically set the "Local Development Server" setting to "Use IIS Web Server".
Changing the "Local Development Server" setting to "Use IIS Express" fixed the problem immediately.
To access this setting right-click the Azure cloud project file in your solution, select the "Properties" option, tab down to "Web" and you'll see the following setup.
Also, make sure you run Visual Studio as administrator
Please check the version of emulator you have installed. If your code is created in older sdk and you have a new emulator installed it will give you this error.
Check the version of Azure APIs in your project, go to Project > references and right click on Azure dlls to check the version, same sdk version must be installed on the system, higher are optional as azure 2.x are not backward compatible.

Azure - error on starting with multiple web role projects

If I have more than one webroles(projects, not instances) in my application, I get this error: (I only get it if I attach a web role. It works fine wit as many worker roles projects as I want)
Microsoft Visual Studio
Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the IIS worker process for URL 'http://127.0.0.1:5100/' for role instance 'deployment(21).CloudPOC.WebRoleToHostDataService.0'. Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
Click Help for more information.
OK
What is wrong here? I can't understand it and I need a webservice project!
Make sure you are starting the Azure project rather than the Web Project itself. You might have set the Web Role as the startup project, and if you do that you'll find that IIS runs the Web App rather than the Azure Dev Fabric, meaning any Dev Fabric specific stuff (like config settings per role) aren't available causing problems.
What you're meant to do is let the Azure Dev Fabric (Compute Simulator) fire up all your roles for you, and it'll also work out if it needs to open a web browser etc.
So right click on the Azure Cloud project, set that as the Startup Project, and try again.
Hope that helps,
Andy
EDIT thought of something else!
Make sure your web.config is compiling to allow debug="true". If you have added a new WebSite to your solution, it won't be so by default:
<system.web>
<compilation debug="true" targetFramework="4.0" />
I had similar issue which got resolved with following steps.
Make sure you have correct version of .net framework 4.0 is intalled. (.Net Framework 4.0.30319 is the latest version)
Uninstall if there isany other .Net 4.0 framework in present on your system by going to Add And Remove programs.
Go to %windir%\Microsoft.NET\Framework64 physical location and remove unwanted .Net framework 4.0 folder
I've also had this problem and it happened when I upgraded my app to 4.0... I ran without debugging and got the following error:
There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined
and after researching that error, I found this:
http://forums.asp.net/t/1571308.aspx/1
which says there's currently a bug w/ vs2010 and 4.0... I took the answers recommendation and commented out the extensions section and it worked for me... Another possible solution.

Resources