Free Support Forum - groupdocs.com

The name 'Groupdocs' does not exist in the current context

hi

i developed asp.net site using groupdocs api but i have problem

Error CS0103 The name ‘Groupdocs’ does not exist in the current context
i call Groupdocs package using consle

<span style=“color: rgb(226, 226, 226); font-family: “andale mono”, “lucida console”, monospace; font-size: 20.4px; background-color: rgb(32, 32, 32);”>Install-Package groupdocs-viewer-dotnet

what problem?
regards

Hi Haitham,


Thanks for using GroupDocs.Viewer for .NET.

Please make sure that GroupDocs.Viewer is installed successfully from the package manager console. Also, please check that the GroupDocs.Viewer reference is listed in the project references. Furthermore, if there is nothing wrong with the installation and the reference then please share the details of error message you are getting. We shall be waiting for your feedback.

Have a nice day.

Warm Regards

Thank you for response

I referenced GroupDoc .dll successfully
I attach images that show error
Regards.


Hi,

I am trying to view the sample application.
Even in that I am get this same error.
I have referenced the Groupdocs viewer dll also.

Thanks
Rev

Hi Haitham,


Thanks for providing the required information.

The code you are using is related to the legacy version of GroupDocs.Viewer and you are adding reference of next generation API (starting from version 3.0.0). Therefore, this code will not work with the next generation API. We recommend you to migrate to the next generation GroupDocs.Viewer for .NET as the legacy version (earlier than 3.0.0) is no more supported.

I am listing down some useful resources for you to get started with the next generation GroupDocs.Viewer for .NET API.


In case of any confusion, please feel free to contact us.

Warm Regards

Hi,

Can u let me know where can I download the GroupDocsViewerWebFormsSampleSolution
latest version.
I want to see the sample solution on how to add the Groupdocsviewer to the web applciation.

Regards

Hi Rev,


Thanks for using GroupDocs.Viewer for .NET.

We have developed a couple of open source document viewer applications using next generation of GroupDocs.Viewer for .NET API. As these applications are open source, you can download, use and modify them according to your requirements. Following are the applications along with their download links.


We have also developed a basic document viewer application for the developers to understand the working of the API. You can download this application from below link.


To learn more about the above mentioned document viewer applications, please visit this article.

If any further information is required, please feel free to contact us again.

Warm Regards

I dont see download option


under this link
https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET/tree/master/Showcases/ASP.NET_WebForm_Front_End

Hi Rev,


You will have to download or clone the complete repository of GroupDocs.Viewer for .NET from https://github.com/groupdocs-viewer/GroupDocs.Viewer-for-.NET. Please see the attached screenshot.

Please try and share your feedback.

Warm Regards

When I open the solution it is missing all the dll’s


Hi Rev,


You will have to restore the NuGet packages in order to run the project. Please follow below steps.

  1. Open project in Visual Studio
  2. Right click on solution and select "Enable NuGet Package Restore"
  3. Click “Yes” in the popup message
  4. Right click on solution again and select "Manage NuGet Packages for Solution"
  5. Click “Restore” button to install missing assemblies
  6. Build and run the project

If you still get any problem, feel free to contact us.

Warm Regards

Hi,

Even After I did Restore Nuget packages.
I get this same error.
I tried googling I found this

<table style=“margin: 0px; padding: 0px; border: 0px; font-size: 13px; border-spacing: 0px; border-collapse: collapse; color: rgb(36, 39, 41); font-family: Arial, “Helvetica Neue”, Helvetica, sans-serif; background-color: rgb(255, 255, 255);”>

<a class=“vote-down-off” title=“This answer is not useful” style=“margin: 0px auto 10px; padding: 0px; border: 0px; font-size: 1px; color: rgb(0, 119, 204); cursor: pointer; background-image: url(“img/sprites.svg?v=8c1c8cba242e”), none; background-size: initial; background-repeat: no-repeat; overflow: hidden; display: block; text-indent: -9999em; width: 40px; height: 30px; background-position: 0px -220px;”>down vote

This error normally happens when you are trying to open a <code style=“margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;”>.csproj directly, not through the solution file, and the <code style=“margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;”>.csproj imports the Nuget targets like this:

<pre style=“margin-top: 0px; margin-bottom: 1em; padding: 5px; border: 0px; font-size: 13px; width: auto; max-height: 600px; overflow: auto; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; background-color: rgb(239, 240, 241); word-wrap: normal;”><code style=“margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; white-space: inherit;”>

In order to solve it, you can either open the <code style=“margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;”>.sln and not the <code style=“margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;”>.csproj directly…or remove the <code style=“margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;”>import line above.

Notice that the mentioned error will only happen when you are using <code style=“margin: 0px; padding: 1px 5px; border: 0px; font-size: 13px; font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; background-color: rgb(239, 240, 241); white-space: pre-wrap;”>solution wise package restore, which isn’t even recommended anymore.

But I dint find <span style=“font-family: Consolas, Menlo, Monaco, “Lucida Console”, “Liberation Mono”, “DejaVu Sans Mono”, “Bitstream Vera Sans Mono”, “Courier New”, monospace, sans-serif; white-space: inherit; background-color: rgb(239, 240, 241); font-size: 13px;”> in the solution .






Hi Rev,


Please make sure that you are opening .sln file in Visual Studio. Also, don’t forget to enable NuGet packages of the solution (see attached image) otherwise you will always get the error that is shown in error.png.

Please check and share your experience.

Warm Regards

YES I did what ever you have mentioned.

Still I am getting the same error.
I am using visual studio 2015.

Hi again,


It seems that your NuGet package is not getting enabled properly. Can you please send us the screenshot of the files and folders inside Examples directory (see folders.png as a sample)? Also, please send us screenshot of the options when you right click on the solution in Visual Studio (see options.png as a sample). We shall be waiting for your response.

Warm Regards
Hi,
Thanks for your continuous support.
Please find the documents and below is my setup.

1. I am using visual studio 2015 trial version.
2. I have installed GroupDocs.Viewer_3.7.0-NET. msi.
3. I have taken screen shots of before and after restore of Nuget packages.

Thanks
Reva

Hi Reva,


Thanks for providing the required screenshots.

We investigated your scenario and found that you can get rid of this problem by following below steps.

  1. Close solution in Visual Studio
  2. Locate GroupDocs.Viewer.Examples.CSharp.csproj file in project folder (see attached csproj.png)
  3. Open this .csproj file in Notepad
  4. Remove the section which is highlighted in attached csproj_edit.png and save file
  5. Load solution in Visual Studio and Restore NuGet Packages
  6. Build project

Please try and share your experience.

Warm Regards

Hi,

Yes this solved the issue of build failure.
Now I am able to build successfully thank you for that.
But please find the steps I took after the build was successful in order to execute the application and where I am struck.

1. First I dont have any GroupDocs.total.lic file anywhere in the downloads.
2. I just tried to rename the plain Licence file as GroupDocs.total.lic and pointed it.
3. When I tried to run the application I am getting this error.

Basically I want to execute the application and see the UI and explore whether Groupdocs.viewer will fit our requirment?
I am still under the in the trial period what to do under this step?

Thanks
Reva

Hi Reva,


Its good to know that your issue is resolved.

If you do not have the license file then there is no need to create a plain license file manually. You can comment the apply license code and in this case the API will work in trial mode with certain limitations. However, you can also get a free temporary license (valid for 30 days) to use the API in full licensed mode. To get the temporary license, please visit http://www.groupdocs.com/corporate/purchase/purchase-policies/temporary-license.

If you have any other question, please feel free to ask.

Warm Regards

Hi,

First time when I commented the licence file line and ran the application, I was able to see the pdf inside the viewer.
When I stopped and ran it again , I am getting this error.
I am not sure what is this
PageImage pageImage = pageImages.Single(_ => _.PageNumber == pageNumber);
line does!