There were two main violations of Norwegian neutrality by Royal Navy vessels during the Second World War. The first was the capture of the German tanker Altmark, while the second involved minelaying off several Norwegian ports.
In September 1939, the Altmark was operating in the South Atlantic, supporting the German heavy cruiser Admiral Graf Spee. The Graf Spee attacked Allied merchant ships in that region. She resupplied from the Altmark, and transferred prisoners from sunken ships to her. After the scuttling of the Graf Spee, the Altmark attempted to return to Germany, with 299 British merchant seamen and officers aboard. Her route took her around Scotland, and down the Norwegian coastline - much slower than the straight route through the North Sea, but safer. While she had managed to avoid British ships searching from her until she reached Norwegian waters, her position was reported once she entered it. In accordance with international law on ships traversing neutral water, her papers were inspected but she was not searched. As she made her way south, she was accompanied by several Norwegian vessels, mainly torpedo boats. British aircraft fixed her position on the 14th February 1940, and she was then pursued by a force of destroyers. Late on the 16th, she was driven into the Jossingfjord, in southern Norway, by the pursuing destroyers. The destroyers withdrew from Norwegian waters to await further instructions. These received, the leading destroyer, HMS Cossack, followed Altmark into the fjord, despite the protestations of the escorting Norwegian vessels. Altmark was fired upon by Cossack, forced aground and boarded. The British prisoners were freed, and the Cossack retreated, mission accomplished. The Norwegian government made a strong protest. This incident also convinced Hitler that the Allies had no intention of respecting Norwegian neutrality, leading to an acceleration of plans for the German invasion of Norway.
The second was a plan known as Operation Wilfred. The aim of this plan was to reduce the flow of iron ore, shipped from the Norwegian port of Narvik. The ore was mined in Sweden, but shipped from Narvik, as it was the only year-round ice-free port available. German ships were, in complete accordance with Norwegian neutrality, using Norwegian territorial waters to avoid the Allied blockade of Germany. The minelaying aimed to force these ships to leave Norwegian waters, putting them into a position where they could be intercepted. Two minefields were to be laid, with a third being simulated using oil drums. The first minefield was to be laid off the Lofoten Islands, at the entry to the Vestfjorden (the sea area in which Narvik can be found). The second was to be laid off Statlandet, while the simulated minefield was to be laid off Kristiansund. Operation Wilfred was launched on the 5th April 1940, as German ships sailed to invade Norway. On the 7th, several of these ships were sighted, and the Statlandet force was recalled, to avoid an engagement. On the 8th, the simulated minefield was laid by the cruiser HMS Birmingham, and destroyers HMS Hyperion and Hero. They remained in the area to warn shipping of the 'minefield'. Slightly later, the minefield at the Vestfjorden was also laid. However, the Norwegian government could not make a major protest, due to the German invasion the following day.
Sources:
Naval Operations of the Campaign in Norway, April-June 1940, David Brown, Routledge, 2000
The German Invasion of Norway: April 1940, Geir Haarr, Seaforth, 2011
The Gathering Storm: The Naval War in Northern Europe September 1939 - April 1940, Geir Haarr, Seaforth, 2012
The Rule of Law in International Affairs, Brian Simpson, Proceedings of the British Academy, Volume 125, 2003