I’d been trying to launch the Cassini web server from a PowerShell script for quite awhile, but kept getting an error when I tried to display the configured website in a browser. When I opened up a debugger, it revealed a FileNotFoundException with the following details:
“Could not load file or assembly ‘WebDev.WebHost, Version=18.104.22.168, Culture=neutral, PublicKeyToken=…’ or one of its dependencies…”
Since the WebDev.WebHost.dll was present in the correct .NET Framework directory, the FileNotFoundException was especially puzzling. Fortunately, one of my colleagues figured out what the issue was. WebDev.WebHost.dll wasn’t in the GAC. Once the file was added to the GAC, I was able to launch Cassini and display the website with no problems.