• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2142
  • Last Modified:

C# .NET Deploying application and Report components not found.

I have developed a C#, WINFORMS application that uses Report Viewer.  When I run it locally from within Visual Studio, it runs fine.

When I deploy and run the .EXE from my PC, I get the following error:
************** Exception Text **************
Microsoft.Reporting.WinForms.LocalProcessingException: An error occurred during local report processing. ---> System.ApplicationException: The report definition for report 'C:\Program Files\Inventory\VersionControl\..\..\Staging_Report.rdlc' has not been specified ---> System.IO.FileNotFoundException: Could not find file 'C:\Program Files\Staging_Report.rdlc'.
File name: 'C:\Program Files\Staging_Report.rdlc'

Staging_Report.rdlc is included in C:\Program Files\Inventory, with the application EXE and DLL's.

HOW DO I CORRECT THIS?
0
MGothelf
Asked:
MGothelf
  • 5
  • 4
  • 2
  • +1
1 Solution
 
surajgupthaCommented:
make sure you windows application code looks for the rdlc files at a relative path. Because if you hardcoded the rdlc paths, the application may be installed in another directory and it might be found. or save the paths to the application's config files
0
 
MGothelfAuthor Commented:
How do I say look in a relative path?  I want it to be in the same director as my EXE.
0
 
pothireddysunilCommented:
I think you need to use the relative path instead of absolute path.
i think it has to search the file in the same directory. I
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
MGothelfAuthor Commented:
I Know I need a relative path?  But how do I specify a relative path?  I didn't do anything specific when I added the item to my project, I just selected the template and added to the project.  I can't find anywhere that the path is specified.
0
 
jsakhtarCommented:
It looks like you are refering to the file as ..\..\Staging_Report.rdlc in your code, but when you install your application you dont place the file 2 directories beneath the exe.

Remove the ..\..\ from your references to the file - perhaps set the property to copy it ot the output directory
0
 
MGothelfAuthor Commented:
I understand what you are saying about removing the ..\..\.  

WHERE DO IF FIND THIS CODE TO MODIFY IT?

I build my project in Visual Studio by just adding items to the project.  

I DIDN'T WRITE ANY CODE.  WHERE DO I FIND THE REFERENCES SO I CAN MODIFY THEM?
0
 
surajgupthaCommented:
Are you specifying the path of these files in the app config file?
0
 
MGothelfAuthor Commented:
NO.  I am not putting anything in the app config file.  All that is there are the database connection strings I am using.
0
 
surajgupthaCommented:
You might have embedded the reports on your pages. Check the path of the report objects on ur web pages to see if the path is hardcoded
0
 
MGothelfAuthor Commented:
THIS IS NOT A WEB APPLICATION.

IT IS A WINDOWS APPLICATION.

CAN SOMEONE PLEASE JUST TELL ME WHERE TO LOOK FOR THE PATH?  WHERE IS IT SPECIFIED?  THEN I CAN CHANGE IT.
0
 
surajgupthaCommented:
If it is a windows application go and check the properties in the form that contains the report. check and see if the path of the report used in the form is present in one of its properties
0
 
jsakhtarCommented:
Or in the resources pages of the form generator
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now