A barrier such as a fence is formed by welding conductive upright members to conductive U-shaped rails by a projection resistance welding process. The rail includes at least one weld-forming region which projects within the rail channel, and may be formed within as a ridge, or as a longitudinally spaced series of nipple-shaped projections. The upright member is transversely positioned within the rail channel in contact with the weld-forming region. A welding current transmitted between the upright member and the rail causes the weld-forming region to at least partially melt and form a weld within the rail channel.