3
votes

I see the following error in Visual Studio for both Web Sites and Web Applications in Visual Studio for a .NET (presentation) website, on a Windows Server 2008 R2, 64-bit.

Could not load file or assembly 'Tridion.ContentDelivery.AmbientData' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I don't get an error when viewing the site outside of the IDE (with site setup in IIS and visited with a browser).

My colleagues explained this is related to using Visual Studio's built-in web server (Cassini), which I understand conflicts with the 64-bit Tridion.ContentDelivery.AmbientData.dll.

  1. What are appropriate ways to manage this error to develop .NET sites with SDL Tridion's Content Delivery API?
  2. Any difference between what I should do if working with a Web Application versus Web Site?

I notice setting Property Pages > Build to No Build removes the error and still allows debugging, but am not sure if I'm missing something by doing this.

3
You could give IIS Express a try - Alex

3 Answers

4
votes

Cassini doesn't support 64-bit out-of-the-box, but you can apparently get a version that does.

See the following topic right here on StackOverflow: Is Visual Studio 2010 WebDev WebServer (Cassini) 64-bit compatible?

3
votes

If you want to be able to debug from VS, the only reliable way I found is to configure the site to run in 32 bits.

Otherwise, setting a breakpoint and attaching to W3WP works fine.

N

0
votes

In some cases, for each application runs creates a temp directory, where application dlls are put by VS, it always has unique name. Maybe it's not tour case, but you can try to put this dll in GAC first. To exclude this case