title: An error occurred during local report processing.The definition of the report ' is invalid
body: <p>I am new to using SSRS. I am using a <code>.rdlc</code> file for report generation in a PDF with VS 2012. When I tried to set the parameters like</p>
  
  <pre><code>ReportParameter param = new ReportParameter(kvp.Key, kvp.Value);
  LocalReport.SetParameters(param);
  </code></pre>
  
  <p>This throws an exception:</p>
  
  <blockquote>
    <p>An error occurred during local report processing..The definition of the report '' is invalid.. Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.</p>
  </blockquote>
  
  <h2>More details:</h2>
  
  <pre><code>{Microsoft.Reporting.WebForms.LocalProcessingException: An error occurred during local report processing. ---&gt; Microsoft.Reporting.DefinitionInvalidException: The definition of the report '' is invalid. ---&gt; System.IO.FileLoadException: Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.
     at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
     at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
     at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
     at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark&amp; stackMark)
     at System.Activator.CreateInstance(String assemblyName, String typeName)
     at System.AppDomain.CreateInstance(String assemblyName, String typeName)
     at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
     at System.AppDomain.CreateAppDomainManager()
     at System.AppDomain.Setup(Object arg)
     at System.AppDomain.nCreateDomain(String friendlyName, AppDomainSetup setup, Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, IntPtr parentSecurityDescriptor)
     at System.AppDomainManager.CreateDomainHelper(String friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
     at System.AppDomainManager.CreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup appDomainInfo)
     at System.AppDomain.InternalCreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup info)
     at System.AppDomain.CreateDomain(String friendlyName, Evidence securityInfo, AppDomainSetup info)
     at Microsoft.Reporting.ReportCompiler.CreateCompilationTempAppDomain()
     at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot&amp; snapshot)
     --- End of inner exception stack trace ---
     at Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot&amp; snapshot)
     at Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot&amp; snapshot)
     at Microsoft.Reporting.LocalService.CompileReport()
     at Microsoft.Reporting.LocalService.Microsoft.Reporting.ILocalProcessingHost.CompileReport()
     at Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
     --- End of inner exception stack trace ---
     at Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession()
     at Microsoft.Reporting.WebForms.LocalReport.SetParameters(IEnumerable1 parameters)
     at Microsoft.Reporting.WebForms.Report.SetParameters(ReportParameter parameter)
  </code></pre>
  
  <p>What am I missing. In some posts, it 's been advised to use missing <code>Microsoft.ReportViewer.PorcessingObjectMode.dll</code>. I did that so I have all the required dlls like:</p>
  
  <pre><code>-    Microsoft.ReportViewer.Common.dll
  -    Microsoft.ReportViewer.WebForms.dll
  -    Microsoft.ReportViewer.ProcessingObjectModel.dll
  </code></pre>
  
  <p>are there.</p>
  
  <p>I referred to this <a href="http://www.prominder.eu/post/2010/02/04/Error-The-definition-of-the-report-Main-Report-is-invalid.aspx" rel="nofollow noreferrer">post</a>. But still I could not get this done.</p>