Wednesday, December 16, 2009

Using the File attribute of the appSettings element of a .NET config file

If you need to share configuration settings among multiple .NET assemblies, the practice of maintaining separate config files for each assembly can quickly become tedious. For instance, if you have multiple executables within a directory that all need a 'ConnectionString' entry in their config file, the traditional method in .NET would be for each executable to have its own config file. This can become a burden in an enterprise environment when you need to change the connection string, as you would be forced to change each individual config file. Fortunately, there is a better approach. This better approach involves using the File attribute of the .NET config file's appSettings element. This attribute should contain the relative path to a custom config file, which all other applications can share. The description from MSDN on the appSettings File attribute follows:

Specifies a relative path to an external file containing custom application configuration settings. The specified file contains the same kind of settings that are specified in the <add>, <remove>, and <clear> elements and uses the same key/value pair format as those elements. The path specified is relative to the main configuration file. For a Windows Forms application, this would be the binary folder (such as /bin/debug), not the location of the application configuration file. For Web Forms applications, the path is relative to the application root, where the web.config file is located.

Note that the runtime ignores the attribute if the specified file can not be found.

Essentially, each executable's config file will contain an entry such as:


xml version="1.0" encoding="utf-8" ?> <configuration>  <appSettings file="settings.config">  </appSettings> </configuration>

where "settings.config" is a custom config file which looks something like this:


<appSettings>  <add key="Setting1" value="This is Setting 1 from settings.config" />  <add key="Setting2" value="This is Setting 2 from settings.config" />  <add key="ConnectionString" value="ConnectString from settings.confg" /> </appSettings>

When you run your application, you simply use the AppSettings property from System.Configuration.ConfigurationSettings to reference the configuration setting, such as:


Dim s As String = _    System.Configuration.ConfigurationSettings.AppSettings("ConnectionString")

In this case, if there is a 'ConnectionString' key in the individual config file, that value will be used. Otherwise, the value will be retrieved from the shared "settings.config" file.

As indicated above, if you choose, each individual config file can also define the keys which are present in the shared config file. In that case, the individual config file settings will take precedence over the shared config file. That could be useful in a situation where you want to quickly test a new setting without disrupting the other applications which are using the shared config file.

Monday, December 14, 2009

Securing your WCF Service

Enterprise .NET Community: Securing your WCF Service

Instant Answers in Google Suggest

Instant Answers in Google Suggest

The Human’s Guide To Running Google Chrome OS

The Human’s Guide To Running Google Chrome OS | Lifehacker Australia: "The Human’s Guide To Running Google Chrome OS
By Gina Trapani on December 3, 2009 at 4:00 AM
Two weeks ago Google released the source code of their upcoming Chrome OS operating system, and thanks to some fast and hard-working developers, you don’t have to be a coder to try it out.

While Google’s official word is that you have to build Chromium OS from source to try it out on your computer, several developers have released installable builds that save you the trouble. Let’s take a look at how to take Chromium OS out for a spin without typing make or build."

How to authenticate user while calling WCF service using AJAX?

How to authenticate user while calling WCF service using AJAX? - ASP.NET Forums

Friday, December 11, 2009

Hosting WCF Services (Very nice article)

CODE Magazine - Article: Hosting WCF Services: "Hosting WCF Services

Windows Communication Foundation (WCF) Services can be hosted with Internet Information Services (IIS); with the new Windows Activation Service (WAS) installed with IIS 7.0; or with any managed application process including console, Windows Forms, Windows Presentation Foundation (WPF), or managed Windows service applications. Selecting the right hosting environment for your services is a choice driven largely by deployment requirements related to transport protocol and operating platform."

Friday, December 4, 2009

Translate



Friday, November 13, 2009

SharePoint 2010 Differentiators

Here are some of arpan shah's comments on SharePoint 2010 differentiation with other vendors...

1. Real Choice: Anywhere, Anytime, Anyhow

To some it may seem surprising, but SharePoint offers more choice to users & customers than any other vendor out there.

- End Users can choose to access and interact with SharePoint with a rich client like Office (my personal favorite in 2010 is SharePoint Workspace), browser technology of their choice (Internet Explorer, FireFox, Safari) or any mobile device. With unparalleled Office integration and cross-browser support, other platform vendors don’t even come close here. Many choose to offer their application only in the browser; with SharePoint, you get it all. Not only can you access SharePoint through the device of your choice, but the SharePoint 2010 User Experience is candy. With its wiki-like editing capabilities, it’s really easy to interact with. AJAX and Silverlight make interaction very smooth and seamless. Our investment with MUI also enables people to interact with SharePoint in their preferred language!

image

image

- Organizations also have choice. They can scale up or scale down their deployments; install services on the same server or on to different servers; they can choose to use Virtualization technology or install on the metal. And most recently, Microsoft offered the choice to organizations to install on-premises and choose to subscribe to a service in the cloud with SharePoint Online. With the SharePoint 2010 wave, SharePoint Online is close to parity from an end-user feature perspective when compared to SharePoint On-Premises.

image

- Data in SharePoint; Data outside of SharePoint. You pick. And that “you” isn’t just the IT department; that “you” can be an end user. SharePoint offers a number of ways to integrate with Line of Business data through standards support and investments like Business Connectivity Services (BCS, read/write capability) and tools like SharePoint Designer & Visual Studio. You can rather easily surface data in SharePoint; in fact, there are many whitepapers we’ve published and other vendors have published to show how this can be done. You can even take your business & SharePoint data with you offline with SharePoint Workspace.

Across all fronts, SharePoint 2010 will provide even more choice which is a win for our customers and partners.

2. Real Unified Platform
Loosely coupled components don’t make a platform. Some vendors package and market their functionality as one platform, but in reality they have siloed technology that must be glued together. While the tagline “6 servers in 1” is sometimes used to describe SharePoint, it’s misleading. SharePoint is “1 server” which has a set of integrated features. This has multiple benefits: 1) cross-workload functionality that can be leveraged to create compelling solutions and 2) costs can be cut with one platform that end users have to be trained on, that developers have to develop on and IT has to manage.

In the 2010 release, we’ve heavily invested in providing a great experience for IT to manage SharePoint as a mission-critical enterprise platform. From deployment, to patching, to management, to upgrade, we’ve done a lot of work. Furthermore, SharePoint 2010 provides a scalable infrastructure to store terabytes of content and millions of items in a single list. Along with scale, we also include governance controls for IT.

image

3. Spectrum of Empowerment. Welcome to Composites.
Many vendors provide developer extensibility but SharePoint is unique in that it empowers all users from end-users to power users to professional developers to create solutions. With SharePoint, you don’t have to write code to develop solutions. SharePoint offers users the ability to create no-code solutions using the browser and SharePoint Designer (a free download for SharePoint customers). In fact, with SharePoint 2010, we have a workload dedicated to this category of solutions – Composites. Composites includes applications like mash-ups, forms/workflow, data tracking, data analysis and more! Brand new features like Access Services, improved InfoPath forms integration, improved Excel services, improved workflow, business connectivity services, better browser and SPD functionality (just to name a few), enable SharePoint users to create engaging and powerful solutions.

For professional developers, SharePoint builds on the .NET platform and offers fantastic tooling with Visual Studio 2010, features like Business Connectivity Services, RESTful APIs, Silverlight support, Client OM and much more. On top of all of this, the nice thing with SharePoint 2010 is that many of these things are possible not only with SharePoint on-premises but with SharePoint Online too.

Of course, with great power comes responsibility and investments we’ve made with governance and Sandboxed Solutions help IT allow for secure & safe custom code deployment.

image

image

image

SharePoint 2010 Developer Center

The SharePoint 2010 Developer Center is now live on MSDN. This new sub-site includes Getting Started modules, as well as a Beta version of the SharePoint 2010 SDK.

To read more, take a look at the SharePoint developer documentation team blog, or head straight to theSharePoint 2010 Developer Center to see detailed, public technical information and instruction around both SharePoint Foundation and SharePoint Server 2010.

Wednesday, May 27, 2009

SharePoint Log Viewer (Free Download with source code)

SharePoint Log Viewer is a simple tool that is used to read, filter and find the SharePoint log messages very easily and quickly with out going through the text files.

Enterprise Integration software Process Integrity
SharePoint Log Viewer


Download SharePoint Log Viewer

Key Features:


1. Multiple Log File Selection.
2. Multiple Filter selection with easy to use check box facility.

3. Quick Search Functionality.

4. Combines all the broken messages.

5. Refresh Functionality to retrieve new data.

6. Read full message information by just clicking on the row.

7. .NET 3.5 Framework based.

8. Very fast and user friendly.

Steps to use the tool:

1. Copy following files "SPLogViewer.exe " and "SPLogViewer.exe.config" in to your machine.


2. Run the “SPLogViewer.exe”.


3. If SharePoint is installed on your machine, the default log folder is set to

“c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS”.

If not, it will ask you to change the folder path once you start the program.

Enterprise Integration software Process Integrity
Settings Window


4. To change the path, click on settings menu. Change the log folder path by browsing through the windows directory or directly pasting the path


5. Once the folder is located, tool will automatically load all the log files present in the folder and display the latest log file information.


6. Multiple log files can be selected to view the combined log data.

Enterprise Integration software Process Integrity
Multi Log file selection


7. Messages can be filtered based on “Level” or “Process” or “Category”. Just click on any of the tree nodes on the left side to create filter. Multiple filters can be selected.

Enterprise Integration software Process Integrity
Multi filter selection

8. Messages can also be searched by typing a string in the search box. Messages will be filtered based on the filters that are already selected.

Enterprise Integration software Process Integrity
Search Box


9. Each message information can be viewed by selecting a row in the grid.

Friday, May 22, 2009

Running custom HttpHandler in IIS 7

When I am using a custom HttpModule/HttpHandler in IIS 7 under Vista, the handler does not fire. The fix is to change the application in IIS to the "Classic .NET AppPool". You can also use the DefaulAppPool by changing the web.config.

Also, IIS7 on Vista Client doesn't currently supports ASP.NET substitution caching while running in integrated mode. If you change it to classic mode it does.

Sunday, May 10, 2009

My WordPress Blog...

http://sharathreddyp.wordpress.com/

Adding Associations to BDC using Enteprise Enabler’s BDC Tool

Associations are used to create relationship between Entities in LOB application.

StoneBond’s BDC Tool allows users to easily create Association between mutliple tables in any database (Not limited to SQL and Oracle).

Following Steps are used to create simple association between Customers and Orders Entities of Northwind Database.

  1. Open Enterprise Enabler studio and create source templates for Customers and Orders Table.
  2. Create surrogate destination templates for these two source entities.
  3. Create two maps between source and destination templates.
  4. Open BDC Tool from Tools–>BDC Tool.
  5. Enter required information to create Application Definition File.
  6. Create a new Entity named Customers and select the map that is created for Customers Table. Select CustomerId as the Identifier in the Entity.
  7. Once the Entity is created, methods for each method instance (Finder, SpecifiFinder and IdEnumerator) will be added to methods list.
  8. Add another entity named Orders and select the map that is created for Orders Table. Select OrderId and CustomerId’s as identifiers in Orders entity.
  9. Three methods will be automatically added to it… 
  10. Create a new method named GetOrdersByCustomerId and click on Add New parameter.
  11. Select the CustomerID column from the Customers Entity to create a relation ship.
  12. Once the Identifier from different entity is selected, it will be considered as a new association. 
  13. Fill up required information for adding association and click on ok button.
  14. Click on Generate button to create Application Definition File.

Integrating SharePoint with LOB applications

Business Data Catalog (BDC) is a SharePoint feature that allows users to access external data from within SharePoint. BDC offers an excellent way to integrate SharePoint with line-of-business (LOB) applications.

StoneBond Technolgies (www.stonebond.com) offers a integration product (Enterprise Enabler + BDC Tool) which allows users to connect to any database and integrate data with SharePoint .

On Twitter

If you are on twitter, you can follow me @sharathreddyphttp://twitter.com/sharathreddyp .
You also can follow our company Stone Bond Tech. @stonebond http://twitter.com/stonebond 

Friday, April 24, 2009

Setting Keyboard Shortcuts in Visual Studio

  1. Start Visual Studio.
  2. Choose Tools—>Customize.
  3. Click on the button Keyboard.
  4. A complex looking dialog will appear.
  5. The left section lists the various items which are customisable. Keyboard will be selected in this case.
  6. The settings you change may interfere with settings of other users who may share your machine. To avoid this, save your settings as a collection of named settings. Before you customise anything, click on Save As and choose a different name for your collection of settings.
  7. Type part of the menu or toolbar button for which you would like to assign a shortcut key in the textbox Show Commands Containing. This launches a substring search on all the commands and returns a filtered list. Browse the set of commands and locate the one you want.
  8. If the command already has a key assigned, view it. It is possible that there is a shortcut key that is not shown in the menus. If this is the case, memorise the shortcut and exit this dialog. No customisation is required.
  9. If there’s no shortcut, or you dont like the default shortcut, customise it. Locate the command and go to the Press shortcut key(s) textbox. Press the required combination. VS understands which keys you pressed and puts their names there. Remember that you can specify multiple shortcuts for a single command.
  10. It’s possible that the keyboard shortcut that you are trying to use is already used by VS.NET for some other existing command. If so, this command will be listed. You can override this shortcut and map it to the command selected by you. If you dont want to disturb the current assignment, type a new keyboard shortcut. Remember to delete the existing shortcut before you type the new one.
  11. Click on Assign.