3

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.

1
  • You could give IIS Express a try
    – Alex
    Aug 3, 2012 at 11:34

3 Answers 3

4

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?

2
  • +1 for the option to use a different development server. I installed CassiniDev on my VM. Still getting the error for now--I'll try a bit more and report back. Aug 4, 2012 at 21:31
  • I ended up using CassiniDev for my own development, but IIS on development boxes I don't own (training and internal development). Jan 30, 2013 at 5:36
3

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

4
  • 2
    You can also configure VS to use IIS for debugging. Just create a site on your local host, use a 64-bit app pool, and configure your project (on the web tab) to use a local IIS server. VS will take care of attaching the process for you.
    – Quirijn
    Aug 3, 2012 at 13:52
  • +1 to Quirijn's comment. I found the (MSDN article)[msdn.microsoft.com/en-us/library/ms178108.aspx] on such a setup for Web application projects in Visual Studio. "Web Sites" have IIS Express as an option. Aug 4, 2012 at 15:07
  • I'm closer. Attaching to w3wp (or WebDev.WebServer40.EXE with CassiniDev with ASP.NET 4.0) does get the breakpoint to trigger. But I still get the error (but now in the browser). To make it "run in 32 bits" -- is that just using the 32-bit dlls, or is there a setting in Visual Studio? Aug 4, 2012 at 21:38
  • 1
    If you are getting the error in the browser, then the DLLs in your bin folder are not the same format as your Application Pool uses. That's not related to debugging, though. Aug 6, 2012 at 9:07
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.