Paulius
Paulius

Reputation: 139

CS0246: The type or namespace name 'CrystalDecisions' could not be found

I trying open already created ASP.NET project in another PC locally via IIS manager. But I'm getting this error:

CS0246: The type or namespace name 'CrystalDecisions' could not be found (are you missing a using directive or an assembly reference?)

enter image description here

I've tried the following to resolve this:

  1. Added Namespaces :

    CrystalDecisions.CrystalReports.Engine;
    
    CrystalDecisions.Shared;
    
    CrystalDecisions.ReportSource;
    
  2. Target Framework set to .Net Framework 4.

  3. Installed CrystalDecisions.CrystalReports.Engine via NuGet Package manager.

Upvotes: 6

Views: 35741

Answers (5)

Ehsan
Ehsan

Reputation: 33

I have also experience the same issue, i just install the crystalReport run time file and work for me . you can take help from (https://www.tektutorialshub.com/crystal-reports/how-to-download-and-install-crystal-report-runtime/)

Upvotes: 0

manojm
manojm

Reputation: 41

I also experienced the same issue. So I realized that my project target framework had changed to 3.5 and I upgraded the framework to 4.5. It helped to resolve my issue.

Upvotes: 0

Shady
Shady

Reputation: 124

Try this:

  1. Locate your C# project file ( YourProjectName.csproj ).

  2. Open it using Notepad++ or any other text editor.

  3. Press Ctrl + F and find for <Reference Include=

  4. There should be a CrystalDecisions.CrystalReports.Engine

  5. If it isn't add this, use the correct version:

    <Reference Include="CrystalDecisions.CrystalReports.Engine, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL" />
    <Reference Include="CrystalDecisions.ReportSource, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL" />
    <Reference Include="CrystalDecisions.Shared, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL" />
    <Reference Include="CrystalDecisions.Windows.Forms, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL" />
    <Reference Include="FlashControlV71, Version=1.0.3187.32366, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
    

Upvotes: 2

Jun Yu
Jun Yu

Reputation: 424

I reopen the project folder by File>Open>Web Site... and save anoter solution, and the error missing.

Upvotes: 0

Yusuff Sodiq
Yusuff Sodiq

Reputation: 935

I just faced this error while running a windows forms application in VS 2019 and below were the steps I took to resolve it:

  • I checked the references node (In project explorer) and all the 4 CrystalDecision packages were there but with a yellow warning icon to all of them so I deleted them all.
  • Then I opened the Nuget package manager to search for each of the packages starting from CrystalDecisions.CrystalReports.Engine. They were all marked as "installed" so I uninstalled and reinstalled them one after the other. And then I built the project successfully. This process removed the packages from the Packages.config file and added them back after installation.

What I noticed was just that the .Net framework version for the packages in the packages.config file was changed from net45 to net40.

So apparently, I have been referencing the wrong .Net version but I wouldn't have realized because the project was building fine before I switched to VS2019.

Upvotes: 2

Related Questions