开发者

500 error when integrating multiple apps in one code base

开发者 https://www.devze.com 2023-04-06 11:16 出处:网络
I\'m trying to set up an MVC application that will service several facebook applications for various clients. With help from Prabir\'s blog post I was able to set this up with v5.2.1 and it is working

I'm trying to set up an MVC application that will service several facebook applications for various clients. With help from Prabir's blog post I was able to set this up with v5.2.1 and it is working well, with one exception.

At first, I had only set up two "clients", one called DemoStore and the first client, ClientA. The app开发者_如何转开发lication determines what client content and facebook settings to use based on the url. example canvasUrl: http://my_domain.com/client_name/

This works for ClientA, but for some reason when I try any DemoStore routes I get a 500 error. The error page points to an issue with the web.config.

Config Error:

Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'facebookredirect.axd'

I am able to add additional clients with no problem, and changing DemoStore to something like "demo" while using the same facebook application settings works fine also.

Working calls:

           http:// localhost:2888/ClientA/
           http:// localhost:2888/ClientB/
           http:// localhost:2888/Demo/

Failing call:

           http:// localhost:2888/DemoStore/

I was thinking this might be an MVC issue, but the Config Error points to the facebookredirect handler. Why would the SDK try to add this value to the config during runtime, and only for this specific client?

Any insight would be greatly appreciated.


I managed to figure out what went wrong here. Silly mistake..

After I had set up the application routes to require the client_name I changed the Project Url in the project properties to point to demostore by default. When I hit ctrl+S a dialog popped up that I promptly entered through without reading.

When I changed the Project Url, IIS Express created a new virtual directory for the project. This was the source of my problem. Why? I'm not sure, but once I removed the second site from my applicationhost.config I was able to access the DemoStore routes.

Moral of the story: read the VS dialog messages!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号