none
Visual Studio 2010 Report Wizard error could not load file or assembly

    Question

  • I am having alot of trouble with making reports in visual studio 2010, everything worked fine in visual studio 2008.  I am currently trying to create a report from a wizard.  I cannot get this to work.

    I have a seperate project in the solution that contains a linq to sql class file.  I reference that project in my website project all in the same solution.  When I try and create a report using the report wizard it gives the error "Could not load file or assembly..." then the assembly it can't load is the linq to sql class project.

    The website can use the linq to sql class project without any problem, the only time I see that error is when I try to create a report definition using the wizard.  This may explain some of the other problems I am having if this can get fixed.

    Friday, May 28, 2010 5:30 PM

All replies

  • Hi Ncollier,

    I performed a test at my side but did not encounter this issue. To let me better understand your issue, could you please first answer my following questions?

    1. Which step of the report wizard did you encounter this issue?

    2. What is the relationship between your LinqToSql class and your report?

    3. Can you simply reproduce this issue by creating a test project with a simple LinqToSql class?

    If you can reproduce this issue, I recommend that you first send me (sqltnsp_at_microsoft_dot_com) your test projects so that I can use to reproduce your issue. So as to let me quickly identify your email, I recommend that you send your email with the subject "<To Charles>http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/c42d3ff5-0e03-40be-9841-469f8c43297b".

    Thanks.

     

     


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Monday, May 31, 2010 10:53 AM
    Moderator
  • Just to answer a few of those.

    Which step of the report wizard did you encounter this issue?
    _________________________________________________________

    I encountered it just as soon as I clicked new report wizard item, it sits there and waits for a little while, it almost shows the initial report wizard screen then it comes up with the error.

    What is the relationship between your LinqToSql class and your report?
    _____________________________________________________________

    There is no relationship.  The report does not even get to the stage where you can pick data.  I want to do the report on a strongly typed dataset that I have allready defined with a sql query.

    Can you simply reproduce this issue by creating a test project with a simple LinqToSql Class?
    _____________________________________________________________________________

    I'm not sure if I can or not, I can tell you that if I delete the LinqToSql dll for the project I made, then everything works perfectly.  I find it very odd that the dll has nothing whatsoever to do with my report.  I almost think the report wizard must be looking at the project trying to come up with everything that could be used as a datasource and it finds that dll and quits.  However the dll works fine if I use it by itself, like if I perform a linq to sql query with code, I'd never had a problem with it.  Also if I delete it, it will come back since the project that has the linq to sql stuff is referenced by my main website project.  So I've just been deleting it making the report then it automaticaly gets added back, and the report still works.

    Pretty odd behavior I think...

    Tuesday, June 01, 2010 12:26 PM
  • ncollier,

    To further diagnose this issue, please help collect process monitor trace, compress it to a .zip file and send it to sqltnsp_at_microsoft_dot_com with the email subject "<To Charles>http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/c42d3ff5-0e03-40be-9841-469f8c43297b".

    You can download process monitor here:
    http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx

    Steps to collect the trace:
    1. Start process monitor.
    2. Try creating a report with report wizard to reproduce this issue.
    3. Stop capture in process monitor.
    4. Save the trace to a file.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help
    Wednesday, June 02, 2010 9:07 AM
    Moderator
  • Hi there,

    Has there been any resolution to this issue yet?  I'm getting exactly the same behaviour here as well. The workaround suggested by Ncollier seems to work, but it's anoying to have to do each time I want to add a new report etc.

    I definitely think that it's a problem with the dataset solution search function.  For instance, when I have the AJAX control toolkit in my website's bin directory and I add a new report via the report wizard, the dataset dialog lists ALL the possible datasets from the AJAX control toolkit dll.  So it's definitely digging into all the dlls in the bin dir and examining them.  All of my dlls are still targetting .NET 3.5 so that might be something to look at as well?

    Looking forward to a fix for this problem!  I convinved my company to buy VS2010 so that we can target the 2008 reports schema in local mode, but at the moment this is pretty much useless unfortunately.  I'll keep digging to see if I can nail down exactly what the problem is!

    Cheers,

    Tim

    UPDATE: As another workaround I found that the following seems to work: Don't use the Report Wizard and instead create a *.rdlc file and also a dataset with a table adapter for the data you want to show in the report .  Open the report in the VS2010 designer and in the "Report Data" tab select "New DataSet".  This may also fail too, but I found that if I did a clean of the solution immediately before trying to add a report dataset then it worked.  Then manually hook up your dataset and build the report etc.

    Tuesday, July 13, 2010 8:00 AM
  • Hi,

    I am having a very similar issue on two separate machines.

    I am using DotNetNuke as a base website. When trying to either create a new report using the wizard, I get a 'Could not load file or assembly' error for other unrelated references (notably they are in the bin folder rather than the GAC).

    It does not matter if I put the Report Viewer on a complete fresh .aspx page.

    I do not have a problem on those machines when creating a report on a fresh asp website.

    A problem I experience also as mentioned above is that after I create a report manually (without the wizard), and try to use an expression on a table in the rdlc file, it does not see any fields of my configured dataset.

    Monday, October 11, 2010 11:22 AM
  • Hi,

    I am having the very same issue. Is there a resolution yet?

    The project refers some assemblies which in turn refer to other assemblies, the error pointed is for those second layer reference assemblies, and the project does not in anyway depend on the assemblies that the error shows. if i add those assemblies to the bin folder it works fine, but its a pain, adding one after the other to get this working, and a useless overhead.

    any help appreciated.

    Thanks,

    Monday, October 11, 2010 6:02 PM
  • bump :)
    Monday, October 25, 2010 11:29 AM
  • I'm also having the same problem. If I try to create a dataset from the rdlc file (ie not using the wizard) it takes an AGE - about 1/2 hour to bring up the dialog boxes. I thought it had hung until I looked at process monitor and saw that there was a lot of activity.

     

     

     


    Dave
    Monday, December 20, 2010 12:59 PM
  • Rename the bin directory (bin_dover) or what ever.. then the wizard will work..  Rename folder back when you are done..
    • Proposed as answer by NorCis Tuesday, February 01, 2011 12:32 AM
    Friday, January 28, 2011 6:37 PM
  • Rename the bin directory (bin_dover) or what ever.. then the wizard will work..  Rename folder back when you are done..

    Are the cause of this behaviour know by Microsoft and official solution provided?
    Tuesday, February 01, 2011 12:33 AM
  • Rename the bin directory (bin_dover) or what ever.. then the wizard will work..  Rename folder back when you are done..

    This didn't work for me. I renamed the folder but then the report wizard (and new dataset) only gave an option to select a database as the source whereas I wanted to select one of my classes.
    Dave
    Tuesday, February 01, 2011 8:52 AM
  • Are the cause of this behaviour know by Microsoft and official solution provided?

    I have an active call in progress with Microsoft. I'm getting good support but we haven't resolved the problem yet.
    Dave
    Tuesday, February 01, 2011 8:53 AM
  • Worked like a charm.  Didn't like my AJAX DLL but renaming does the trick.  Thanks!
    Wednesday, February 16, 2011 8:16 PM
  • Report Wizard has lot of issues. When I add a new Report Wizard, the Data Source dropdown does not show all the classes in my referenced dlls. When I repeat the process, the options in the Data Source dropdown decreases further. Something funny going on. Its not consistent and reliable.

    I've it working in a different project. Event the help button in Report Wizard does nothing.
    • Edited by D Patel Saturday, June 11, 2011 2:21 PM
    Saturday, June 11, 2011 2:16 PM
  • Report Wizard has lot of issues. When I add a new Report Wizard, the DataSet dropdown does not show all the classes in my referenced dlls. When I repeat the process, the options in the dataset dropdown decreases further. Something funny going on. Its not consistent and reliable.


    Coincidently, a couple of minutes ago I sent an email to Microsoft chasing up my support call. It has still not been resolved.
    Dave
    Saturday, June 11, 2011 2:19 PM
  • Another possible work-around is to created the RDLC file in another project and then copy into the website project.

    My solution contains the asp.net website and several class library projects. Again I was having trouble applying a new dataset to an RDLC file so I tried creating the RDLC file in one of my other projects and then creating the Dataset. This worked perfectly and then I just moved the RDLC back into the website project.

    I've only tried this once, so would be interested to know whether it works for other people.

    Dave.

     


    Dave
    Tuesday, June 14, 2011 10:28 AM
  • Over a year on this one... I am dead in the water, can't create any reports.  Workarounds don't work.  Deleting bin directory worked briefly, then problem resumed and this doesn't help any more.

    Its not as if reporting is an important aspect of database application development, but still, I have some very unreasonable clients who do seem to like reports.  Should I do like Microsoft?  Ignore my users?  Tell them they don't have reports because I decided they don't need them?  Tell them they can't have reports by design, so problem resolved?

     

     


    bill
    Wednesday, June 29, 2011 10:09 PM
  • Hi everyone - I am having exactly the same problem.

    Has anyone found any official solution? 

    Monday, July 09, 2012 9:42 AM
  • I'm having the same problem. I've got my Report Viewer control and when I try to design a new report the Report Wizard launches and VS2010 subsequently crashes...
    Monday, July 09, 2012 4:57 PM
  • I was told that it was because I was using Linq to Sql and that the application should be redesigned to use Entity Framework.

    Dave

    Tuesday, July 10, 2012 7:31 AM
  • I'm having exactly the same problem. I have a web site solution which references an assembly I created. The assembly contains only a few simple classes, causes no problems anywhere else and is nothing to do with the reports in the application.

    When I try to add a new Report Wizard I get the error 'Could not load file or assembly..... etc'.

     

    This is digraceful, and absolutely unnaceptable to have been going on for TWO YEARS. This bug needs to be fixed, and fixed ASAP.

    Thursday, August 09, 2012 2:40 PM
  • The Report Wizard and Data Source Wizard both use reflection to scan the project folder for datasources that can be used by the report. My guess is that reflection is failing because it can't find a dependency. Do you have VS10 SP1 installed? We did serveral fixes in this area for the service pack, if that doesn't work can you provide more information on how to repro the problem (i.e. what external assemblies you may be referencing, version of the .NET Framework that you are using)? Also it would help if you can file a connect bug so we can track this better internally, you can provide a repro project when you file the bug. Thanks!

    https://connect.microsoft.com/

    Matt M.


    This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, August 09, 2012 11:02 PM
  • ...

     Also it would help if you can file a connect bug so we can track this better internally, you can provide a repro project when you file the bug. Thanks!

    https://connect.microsoft.com/

    Matt M.


    This posting is provided "AS IS" with no warranties, and confers no rights.


    I've already done that through my MSDN subscription - Case ID 110121432411489.

    After 11 months of emails, asking me to do tests etc, I was told to re-work my code to use Entity framework.

    This wasn't an acceptable solution as we don't have the time or budget to rework all the data access layer, submit for testing etc just so that we can create a report.


    Dave

    Friday, August 10, 2012 7:01 AM
  • Same problem as others have reported.

    I am referencing EF project 'Model'.

    The report DataSource dialog shows this module, then next time it's not there. Using the report wizard causes an exception 'Could not load file or assembly ... Model... '

    The workaround, as problemsolved4u has suggested is to temporarily remove Bin, then create report then reinstate Bin. Note this is not a fix but a workaround for a bug.

    Is it to do with reflection failing. Are other references, such as AjaxControlToolkit.dll causing the problem? Haven't tested this. Don't have time. Too busy trying to deliver solution.

    Please SSRS team have a proper look at this.

    BTW I have just reinstalled my dev box from scratch.


    • Edited by muzzi_w Friday, November 09, 2012 11:59 PM
    Friday, November 09, 2012 11:55 PM
  • Hi Dave,

    It's been more than a year since your last post, and if you're still finding it difficult to explain to your customers, here's the solution. It's not a workaround - it's a pattern. It doesn't require a rewrite of your DAL either, and I assume you're working with POCOs at the end of the day.

    http://codebetter.com/petervanooijen/2009/07/01/reporting-against-a-domain-model/
    http://codebetter.com/petervanooijen/2009/07/08/domain-driven-reports-adding-custom-code/


    Just code it.

    Monday, June 24, 2013 10:46 AM
  • Has anyone ever got this to work at all?
    Thursday, October 02, 2014 10:26 AM
  • didn't work for me.

    bill

    Tuesday, November 18, 2014 2:31 PM