Stimulsoft with MVC 5

Stimulsoft Reports.WEB discussion
Post Reply
mkeuschn
Posts: 17
Joined: Thu Apr 03, 2014 8:56 am

Stimulsoft with MVC 5

Post by mkeuschn »

The using directive could not find the Stimulsoft Assembly.

Code: Select all

@using System.Web.UI.WebControls
@using NursingHomeStock.Resources
@using Stimulsoft.Report.Mvc

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewBag.Title = GlobalResources.Reports;
}

<h2>@ViewBag.Title</h2>

@Html.Stimulsoft().StiMvcViewerFx(new StiMvcViewerFxOptions
{
    ActionGetReportSnapshot = "GetStatsForNursingHome",
    ActionGetLocalization = "GetLocalization",
    ActionExportReport = "ExportReport",
    Width = Unit.Percentage(100),
    Height = Unit.Pixel(600),
    Zoom = 75
})
When I am Setting the Embed Interop Types Attribute to true then the assembly could be found but at compile time I get following error:
Error 1 Cannot embed interop types from assembly 'c:\svn\lib\Stimulsoft\2013.3.1800\Stimulsoft.Report.Mvc.dll' because it is missing either the 'ImportedFromTypeLibAttribute' attribute or the 'PrimaryInteropAssemblyAttribute' attribute c:\svn\lib\Stimulsoft\2013.3.1800\Stimulsoft.Report.Mvc.dll NursingHomeStock
I have referenced follwoing Assemblies:
  • Stimulsoft.Base
  • Stimulsoft.Report
  • Stimulsoft.Report.Mvc
Am I missing a reference?

I am using MVC5.1

regards
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Stimulsoft with MVC 5

Post by Vladimir »

Hello,

We were unable to reproduce this error. Please send us your test project for analysis.

Thank you.
mkeuschn
Posts: 17
Joined: Thu Apr 03, 2014 8:56 am

Re: Stimulsoft with MVC 5

Post by mkeuschn »

Hello,

I have created a Test Project. In the project you can see that the Using Directive can not resolve your lib.

regards,
Marko
Attachments
StimulsoftTest.rar
(3.51 MiB) Downloaded 544 times
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Stimulsoft with MVC 5

Post by Vladimir »

Hello,

We have corrected your Web.Config file, the assembly now determined correctly.
Please see the attached archive.
WebConfig.zip
(1.24 KiB) Downloaded 396 times
Thank you.
mkeuschn
Posts: 17
Joined: Thu Apr 03, 2014 8:56 am

Re: Stimulsoft with MVC 5

Post by mkeuschn »

Hi,

I have added the modified web.config to the above project. But I got the same error.

I have tried to put the Namespaces in the web.config file in the view folder. But this also do not solve the Problem.

regards,
Marko
Vladimir
Posts: 1462
Joined: Fri Apr 13, 2007 4:05 am
Location: Earth

Re: Stimulsoft with MVC 5

Post by Vladimir »

Hello,

We have checked your project again, MVC ViewerFx works correctly. Please see the attached screenshot:
screenshot.png
screenshot.png (115.38 KiB) Viewed 3428 times
We have also attached the whole project:
StimulsoftTest-2.zip
(10.69 MiB) Downloaded 676 times
If the problem is reproduced, please provide additional information: operating system, version of Visual Studio and installed updates and components, possibly some other nuances.

Thank you.
mkeuschn
Posts: 17
Joined: Thu Apr 03, 2014 8:56 am

Re: Stimulsoft with MVC 5

Post by mkeuschn »

It seems to be a permission Problem. I have set the CopyLocal Attribute of The Assemblies to true, this has solved the Problem.

regards,
Marko
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Stimulsoft with MVC 5

Post by HighAley »

Hello.

If the assemblies are not installed in GAC. You should copy assemblies to the local folder of the application.

Thank you.
Post Reply