Label Cloud

Tuesday, October 23, 2007

Removing (Uninstalling) ClickOnce Web deployed application from Application Cache

I keep looking up a command to completely uninstall a ClickOnce application form the Application Cache. If the application is deployed using "Run from the Web" method, it is not available in the "Add/Remove Programs" control panel. To remove it, you have to clear the application cache. An important note: this will remove ALL applications from the cache. That is usually not a problem, since the next time you run them, they  will be downloaded.

To clear the cache, run the command "mage.exe -cc" from the Visual Studio command prompt.

Mage is using an API call to accomplish this functionality

CleanOnlineAppCache from Dfshim.dll

You can achieve the same functionality by using a command line tool RunDll32.exe

rundll32 %windir%\system32\dfshim.dll
CleanOnlineAppCache

Or create a batch file with the above command

Technorati Tags: , , ,


Share/Save/Bookmark

Wednesday, October 17, 2007

SecureString class

I found a reference to an interesting class while reading MS blogs. System.Security.SecureString might come in handy in whenever you want to keep strings in memory securely.

Technorati Tags: , ,


Share/Save/Bookmark

Monday, October 15, 2007

Software Quote

I am rereading the Code Complete book again. And this quote is just perfect

There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. -C. A. R. Hoare

Someone should write a book "Refactoring to simple" or "Designing so you don't have too"

Technorati Tags: ,


Share/Save/Bookmark

Saturday, October 13, 2007

Providing multiple endpoints for the WCF service

I had to implement compression for an internal WCF service. A requirement however is to make sure that older version of the service is left as is. To achieve that we've added another endpoint to the an existing binding

Here's the original Configuration File for the server.

<services> <service name="Repositories.Clients" behaviorConfiguration="DebugBehavior"> <endpoint name="Clients" contract="IClients" binding="basicHttpBinding" /> </service> <services> <behaviors> <serviceBehaviors> <behavior name="DebugBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors>

The URL for the service is http://hostname/Clients.svc

Here's the new file

<services> <service name="Repositories.Clients" behaviorConfiguration="DebugBehavior"> <endpoint name="Clients" contract="IClients" binding="basicHttpBinding" /> <endpoint name="ClientsCompressed" contract="IClients" bindingConfiguration="compressedConfiguration" binding="customBinding" address="compressed"/> </service> <services> <bindings> <customBinding> <binding name="compressedConfiguration"> <compression compressionMode="GZip" compressionLevel="Normal"/> <httpTransport/> </binding> </customBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="DebugBehavior"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> </behavior> </serviceBehaviors> </behaviors>

The new URL for the service is http://hostname/Clients.svcc/compressed

The old service works just like before. But the new one requires compressed data. It is serviced by a completely separate binding and has independent configuration.

 


You can follow the same above example to specify multiple client endpoints as well. However, if multiple endpoints exist, the WCF Proxy has to be created by specifying an endpoint name.

 

localhost.Clients1Client client = new localhost.Clients1Client("compressed");

Technorati Tags: , ,


Share/Save/Bookmark

Tuesday, October 02, 2007

Working with Java (pure Java)

Last couple of weeks I was writing a lot of code for a Proof Of Concept project. Having to switch from my "native" C# to Java brought out a very interesting experience. Here are some high lights

  • Java is not as evil as it might seems at first. - It is fast, clean and has LOTS and LOTS of libraries and tools available to support your work.
  • It is very possible port logic from GOOD C# code to java code. I am talking about server side code, not WinForms. The development style is very similar. The APIs and Frameworks are so similar, that often the difference in code is only the casing of the function calls.
  • Eclipse Rocks! - So far, I've worked in eclipse, and am totally loving it. One one hand it is a very easy to understand UI with great support for development. On the other hand, it has more options and variations then any other development tool I've ever seen. I wish someone would have adopted it for .NET development.
  • Some things I still don't understand and / or miss. For example - Properties definition instead of using Getters/Setters. Ability to write services. I am still not sure how to run Java daemons in a Unix environment, but for Windows they have to be wrapped into 3rd party tools.
  • It seems that Garbage Collection is implemented better in .NET. I've never had to worry about maximum and minimum heap sized, or freezes within my application for GC run. It seems that those are often the topic sand concerns of the Java world. I've hit the "Out of memory" exceptions on multiple occasions so already. The only time I've ever received one in .NET was with a recursion bug.

Overall. The experience of writing in a different language is excellent. It gives you a very different (and often the same) perspective on software development. I probably would have the chance to learn a new language if I can't apply it, however, if there is a way to apply a new language - I would say - Go for it.

Technorati Tags: , ,


Share/Save/Bookmark
Directory of Computers/Tech Blogs