ict.ken.be

Delivering solid user friendly software solutions since the dawn of time.

NuGet install missing references when you have a packages.config 

Categories: Visual Studio
  1. using the PM console, make a copy of your packages.config file
    [xml]$packages = gc packages.config
  2. delete packages.config
  3. install each package
    $packages.packages.package | % { Install-Package -id $($_.id) -Version $($_.version) }

Remember to put the full path to the packages.config and select the correct project from the PM console dropdown !

Breeze and OData case sensitive 

Categories: Javascript

When using Breezejs with OData you have to keep in mind that the contains filter is case sensitive. This is because the OData standard is case sensitive. Which might seem ridiculous at first, but going from case sensitive into case insensitve is easier then the other way around. Anyway here is the solution for those who make search boxes case insensitive like the rest of us.

var query = breeze.EntityQuery.from('SearchView');
query = query.where("tolower(Description)", breeze.FilterQueryOp.Contains, filterOptions.filterText.toLowerCase());
manager.executeQuery(query).then(querySuccess).fail(queryFailed);

Removing X-Powered-By ASP.Net and other version headers 

Categories: .Net IIS

Most likely you do not want these headers to be displayed in your responses:

  • Server Microsoft-IIS/7.5
  • X-AspNetMvc-Version 3.0
  • X-AspNet-Version 4.0.303319
  • X-Powered-By ASP.NET

Removing X-AspNet-Version

In web.config add this:

<system.web>
<httpRuntime enableVersionHeader="false"/>

Removing X-AspNetMvc-Version

In Global.asax.cs add this line:

protected void Application_Start()
{
MvcHandler.DisableMvcResponseHeader = true;
}

Removing or changing Server

In Global.asax.cs add this:

protected void Application_PreSendRequestHeaders()
{
//Response.Headers.Remove("Server");
Response.Headers.Set("Server","FooServer");
Response.Headers.Remove("X-AspNet-Version"); //alternative to above solution
Response.Headers.Remove("X-AspNetMvc-Version"); //alternative to above solution
}

Removing or changing X-Powered-By

IIS 7 - You can also remove the X-Powered-By header by including these lines to the <system.webServer> element:

<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>

or manually go to IIS7 Management Console and open HTTP Response Headers

Binding IIS wcf services to multiple msmq on the same machine 

Categories: IIS

The most common site bindings used is both net.msmq and msmq.formatname to localhost.

This will however make iis search through all the queues installed in Server/Features/Message Queuing/Private Queues

Best way to bind is to have the private queue named exactly as the .svc wcf service url and then binding to localhost/exactname. It is allowed to use wildchars. eg. net.msmq binds to localhost/logservice/logservice_int.*

For msmq activation read this article: msdn on MSMQ activation

If you need more of an introduction read this: Getting msmq, wcf and iis to work together

Other things to remember

  • appcmd set site "Default Web Site" -+bindings.[protocol='net.msmq',bindingInformation='localhost']
  • appcmd set app "Default Web Site/MsmqService" /enabledProtocols:net.msmq
  • aspnet_regiis.exe
  • aspnet_regiis.exe -iru
Page 19 of 43 << < 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 40 > >>