Tag Archive: .net framework 4.0

I had a data string that used “<w>” as the delimiter passed into a javascript function from an event handler in HTML, and that was totally legal in .NET Framework 3.5. However, .NET Framework 4.0 detected that as a potentially dangerous value. By changing the delimiter to a string without the angle brackets, I stopped getting the run-time error. I thought that was a good improvement made in .NET 4.0.


TFS Error MSB4062

When I was migrating our TFS build to .NET Framework 4.0 from 3.5 SP1, I got the following error.

error MSB4062: The “xxx” task could not be loaded from the assembly xxx.dll. Could not load file or assembly ‘file:///xxx.dll’ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. Confirm that the declaration is correct, and that the assembly and all its dependencies are available.

To resolve this error, you’d have to change the full path to the directory of MSBuild.exe in the TFS build service configuration file.

  1. Stop the Visual Studio Team Foundation Build service.
  2. Open the file C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\tfsbuildservice.exe.config.
  3. Set the path for the new .NET Framework in the MSBuildPath setting: <add key="MSBuildPath" value="C:\Windows\Microsoft.NET\Framework\v4.0.30319" />
  4. Start the service.