Wednesday, July 15, 2009

"This collection already contains an address with scheme http. There can be at most one address per scheme in this collection"

If you are using a third party host like discountasp.net and you are trying to host a wcf service
within your web application and you get this error message:

"This collection already contains an address with scheme http. There can be at most one address per scheme in this collection"

you will need to add the following web.config key:

<servicehostingenvironment>
<baseaddressprefixfilters>
<add prefix="httplinktoyoursite">
</baseaddressprefixfilters>
</servicehostingenvironment>

If you have any tips, tricks or resources you would like to share with the group please email them to Susan Fischer at susan@clinchportal.com

Tuesday, July 7, 2009

Setting the default browser in visual studio

I keep forgetting how to do this and alway have to search for it so I thought I would post the answer here.

Step 1: Open any .aspx file
Step 2: From the File menu choose Browse With:
Step 3: Select the browser from the list and choose set as default.

Voila that is all. Thanks Steve for the answer.
http://stevenharman.net/blog/archive/2007/08/02/setting-a-default-browser-for-visual-studio.aspx

Tuesday, June 30, 2009

Theme not being applied for a certain page

Scenario: You put the default theme in the web.config. You check the theme value all the way through the event chain and its value is correct but the css references never make it to your page.

Solution: You probably overrode the Page.OnInit event and did not call the base.
NOTE: If your page derives from a base page be sure to check if it is overriding properly by calling base.OnInit(e)

The Page.OnInit method does the following
protected internal override void OnInit(EventArgs e)
{
base.OnInit(e);
if (this._theme != null)
{
this._theme.SetStyleSheet();
}
if (this._styleSheet != null)
{
this._styleSheet.SetStyleSheet();
}
}
Obviously by not calling the base.OnInit method on my derived Page class would ignore the inclusion of theme files.

The original answer was found here: http://forums.asp.net/t/1028417.aspx

If you have any tips, tricks or resources you would like to share with the group please email them to chrisw_88@hotmail.com or susan@clinchportal.com and we will add them here.

Friday, May 22, 2009

Forcing a Refresh from JavaScript

I found a good article on how to do this check it out at this link:

http://devel.lubong.com/2007/06/24/javascript-how-to-force-page-to-reload/

They are using the window.location.reload(true); much like I am in my code.
However I did not realize why we use true instead of false. but he explains it so well:

The reload method accepts a boolean value, which, when it is true, causes the page to always fetch document from the server. When none is specified, it defaults to false, which may reload the page from its cache.

The issue I am having and if any of you know the answer is that in firefox on the second call to this I get a popup that says:

To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.


If you have any ideas on why please post them to this blog posting.

Thursday, April 16, 2009

Debugging a windows service

It took me a while to find this again. If you place this line of code in your onstart event then it will launch the prompt to debug and you can run your service in visual studio.

System.Diagnostics.Debugger.Break()

Hope this helps you as well.

If you have any tips tricks, resources you would like to share with the group please email them to Susan Fischer at susan@clinchportal.com

Saturday, April 11, 2009

Error when browsing to wcf service .svc

PROBLEM: You try to hit your WCF Service and get an error. When you try to browse to it you get the following error:

HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

SOLUTION: This usually means that WCF is not registered with IIS. You can manually register it by clicking on start and run and running the following command:

C:\windows\Microsoft.Net\Framework\v3.0\Windows Communication Foundation\servicemodelreg.exe -i

If the directory does not exist then it means the proper version of the .net framework is not installed. You can install the proper version from the Microsoft site.

If you have any tips, tricks, or resources, please email them to Susan Fischer at susan@clinchportal.com and we will post them.

Thursday, April 9, 2009

Session keeps timing out when debugging iis7

I found out why this is happening.

In IIS7 on the Application Pool, there are ping settings that will kill a session if it gets not response. This is great for production as it keeps iis running slim but when debugging in Visual Studio and stopping on a breakpoint that is nasty.

I found an article that explains how to disable the ping or extend the timeout period.
Application Pool Ping setting in IIShttp://technet.microsoft.com/en-us/library/cc725836.aspx

If you come across any tips, tricks or resource you think the group will find helpful please email them to Susan Fischer at susan@clinchportal.com and we will post them here.