Friday, July 30, 2010
Google Custom Search

Go to...

Recent Forum Posts

Our Community

Membership Membership:
Latest New User Latest: clim7777
New Today New Today: 11
New Yesterday New Yesterday: 18
User Count Overall: 10082

People Online People Online:
Visitors Visitors: 6
Members Members: 0
Total Total: 6

Online Now Online Now:

ClearCanvas Community Forums

Can't load ClearCanvas.Dicom.Codec.Jpeg
Last Post 2010-07-09 12:51 PM by ionel.roman. 19 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
bmoloney
Advanced Member
Advanced Member
Posts:47

--
2010-03-03 07:59 PM  

I downloaded the SVN trunk installed all four of the C++ redistributables from Trunk\Distribution\Redstrbutables.  I then built the solution in VS 2008 C# Express SP1.  When I launch the executable I get the error:

Could not load file or assembly 'ClearCanvas.Dicom.Codec.Jpeg'

Searching this error just brings up comments about installing the C++ redistributables which I have done. I have tried uninstalling older 2005 C++ redistributables, reinstalling, and installing updates through windows update. Nothing works.  Any advice is greatly appreciated.

vaibhav2383
Basic Member
Basic Member
Posts:23

--
2010-03-04 07:10 AM  

Hi,

Install the Microsoft Visual C++ 2008 Redistributable Package. That should help.

Regards,
Vaibhav

bmoloney
Advanced Member
Advanced Member
Posts:47

--
2010-03-04 01:57 PM  

As I mentioned I have installed the Visual C++ 2008 redistributables.

I tried uninstalling everything and reinstalling just CCW. When it is setting up the Visual C++ 2008 SP1 redistributable it says that it failed. However CCW still starts up just fine after the install and both of the C++ redistributables show up in my list of installed programs. The version of CCW I compiled still fails to start with the same error.

I then uninstalled the C++ redistributables that came with CCW and installed the ones from the Microsoft website, they both install fine without any visible error message. Again the installed version of CCW works but the compiled version does not. Finally I applied the windows update to the C++ redistributables and still the installed version works but the compiled version does not.

This is on Windows 7 x64.

bmoloney
Advanced Member
Advanced Member
Posts:47

--
2010-03-04 07:00 PM  
Well I finally fixed it by installing the Windows SDK which provides the 64-bit DebugCRT dll. I'm not 100% sure, but I guess anyone else using the Express version of Visual Studio on a 64-bit machine will run into the same problem.
bmoloney
Advanced Member
Advanced Member
Posts:47

--
2010-03-04 07:31 PM  
I spoke a little to soon. Installing the SDK completely fixed the Debug build and made it so that the Release build would seem to work. However in the logs of the Release build I was still getting an error saying "Failed to process plugin assembly ClearCanvas.Dicom.Codec.Jpeg..." but the exception had changed to "System.IO.FileNotFoundException: Could not load file or assembly nunit.framework".

Maybe this is safe to ignore, but I just copied the nunit.framework dll from the Debug common directory to the Release common directory and that got rid of the exception.
steve
Senior Member
Senior Member
Posts:1330

--
2010-03-05 01:26 AM  
This ClearCanvas.Dicom.Codec.Jpeg assembly is a managed c++ assembly. As such, is compiled specifically for x86 & x64 platforms. You're probably using the 32-bit library on a 64-bit platform, which is causing the problem. To build for 64-bit, you have to use the 64-bit version of these libraries. The build is supposed to be setup to use the proper version of these libraries, but it sounds like something is not working properly.

Steve
vaibhav2383
Basic Member
Basic Member
Posts:23

--
2010-03-05 02:04 AM  

Can you try once by rebuilding the ClearCanvas.Dicom.Codec.Jpeg assembly in your envirionment?
The solution file can be found at: trunk -> Dicom -> ClearCanvas.Dicom.sln
Any error in the build can direct you to the correct reason for the assembly not being able to load.

Vaibhav

bmoloney
Advanced Member
Advanced Member
Posts:47

--
2010-03-05 03:29 PM  

Hi Steve,

When I look at the manifest for ClearCanvas.Dicom.Codec.Jpeg.dll (in the plugins directory for both the Debug and Release builds) it has the following dependentAssembly:

assemblyIdentity type="win32" name="Microsoft.VC90.DebugCRT" version="9.0.21022.8" processorArchitecture="amd64" publicKeyToken="1fc8b3b9a1e18e3b"

However the 64-bit DebugCRT dll can not be downloaded from Microsoft support and it is not included with the Express Editions of Visual Studio. You need to download the Windows SDK to get it. I think that is the issue. Am I missing something?

stewart
Senior Member
Senior Member
Posts:1387

--
2010-03-05 03:40 PM  

Hi, I'm not sure why, but the versions that are checked into ReferencedAssemblies are Debug builds, which is why the nunit.framework dependency issue occurs (see this ticket).  The DebugCRT issue is because it's a Managed C++ assembly, so the Express edition of Visual C# definitely won't have it, but are you sure the C++ Express edition doesn't have it?

Regardless, I believe you can build the Dicom.sln with VC++ Express.  If you build the Release version, the problem should go away.

Hope this helps,

Stewart

bmoloney
Advanced Member
Advanced Member
Posts:47

--
2010-03-05 04:03 PM  
Hi Stewart,

Yes I had tried installing VC++ Express while I was troubleshooting and it did not help. Apparently none of the Express Editions come with 64-bit support and to get this you need to download the Windows SDK. Perhaps it would be good to mention on the getting the code page. I am not sure why it was trying to build against 64-bit libraries if it didn't have 64-bit support, but oh well.

I will try building a release version of ClearCanvas.Dicom.Codec.Jpeg with VC++ so that I can avoid these issues when distributing my custom build.

Thanks for everyone's time!
Brendan
bmoloney
Advanced Member
Advanced Member
Posts:47

--
2010-03-17 08:03 PM  
Just wanted to provide a quick update. The express versions of Visual Studio don't support compiling 64-bit binaries (at least not without a lot of trickery). The Visual C# Express Edition can compile for the target 'Any CPU' however, and thus when you try to run it on a 64-bit machine it will look for the 64-bit redistributable. Since the JPEG dll in the SVN repo is a debug build, you need to either download the Windows SDK or use the JPEG dll provided by the CCW installer (when you are running a 'Any CPU' build on a 64-bit machine).
smr99
Advanced Member
Advanced Member
Posts:37

--
2010-04-13 01:09 PM  

Hi,

I am using VS2008 with the CC 2.0SP1 sources.  ImageViewer.sln builds fine. However, I can't build the codecs using Dicom.sln.

Specifically, I can't build the following 6 projects:

  1. ClearCanvas.Dicom.Codec.Jpeg
  2. ClearCanvas.Dicom.Codec.Jpeg2000
  3. libijg12
  4. libijg16
  5. libijg8
  6. OpenJPEG

When I build the solution, they are "skipped".  If I try to build one such project specifically, I get a Microsoft Visual Studio dialog stataing "The operation could not be completed.  Unspecified error".

Are others able to build these using VS2008?  ClearCanvas: do you use this solution or build the codecs with some other means?

 

steve
Senior Member
Senior Member
Posts:1330

--
2010-04-13 01:41 PM  
Steve,

These are managed C++ assemblies and C++ libraries. Do you have C++ components installed with your VS2008 install? Also, these don't work with Visual Studio Express.

Steve
smr99
Advanced Member
Advanced Member
Posts:37

--
2010-04-13 05:19 PM  
Hi Steve,

The error was between keyboard and screen: the afflicted projects were configured to build as x64, but I'm using win32. Once I sorted that out, I got everything but Jpeg2000 to build. Jpeg2000 had unresolved references, so I just removed it. I think it needs a commercial JPEG 2000 library?
steve
Senior Member
Senior Member
Posts:1330

--
2010-04-14 03:14 PM  
Steve,

The Jpeg2000 projects in the repository actually use the OpenJPEG library. These should build properly. We attempted to use this library several years ago, but ran into some image corruption issues with some images, and decided to abandon it. We left the projects in the repository in case there was ever a new version that resolved the issues we had.

Just as an FYI, there has been some activity with OpenJPEG recently, and it appears they may have a new version soon.

Steve
zeyrek
New Member
New Member
Posts:1

--
2010-04-18 06:02 AM  
we had the exact same problem and as a workaround, we copied the dll from 1.5 distribution.
smr99
Advanced Member
Advanced Member
Posts:37

--
2010-04-25 01:03 AM  
Posted By stewart on 2010-03-05 03:40 PM

Hi, I'm not sure why, but the versions that are checked into ReferencedAssemblies are Debug builds, which is why the nunit.framework dependency issue occurs (see this ticket). 

Stewart: I'm curious.  Why are the DICOM codec assemblies provided as binary ReferencedAssemblies rather than being built as part of ImageViewer.sln?

 

steve
Senior Member
Senior Member
Posts:1330

--
2010-04-25 06:11 PM  
This was done because they cannot be built from Visual Studio express, and we wanted Visual Studio Express to be the baseline for developing with the ImageViewer.

Steve
smr99
Advanced Member
Advanced Member
Posts:37

--
2010-04-26 01:42 AM  

Aha.  That makes sense.

Thanks, Steve.

 

ionel.roman
New Member
New Member
Posts:4

--
2010-07-09 12:51 PM  
maybe this helps:
http://www.clearcanvas.ca/dnn/Community/Forums/tabid/69/afv/topic/aff/8/aft/14515/Default.aspx

at least the first part with replacing referenced codecs

Ionel
You are not authorized to post a reply.

Active Forums 4.1
Copyright 2010 ClearCanvas Inc.