Unable to deploy the AX Report in Visual Studio 2010

Hi,

I have developed a report and when I try to build,Rebuild,Clean all are done successfully.But when I deploy the report I am getting the following error

The “DeployToReportsServerTask” task failed unexpectedly.

System.IO.FileLoadException: Loading this assembly would produce a different grant set from other instances. (Exception from HRESULT: 0x80131401)

at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)

at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)

at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)

at System.Activator.CreateInstance(Type type, Boolean nonPublic)

at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)

at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)

at System.Activator.CreateInstance(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& 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.CreateInstanceAndUnwrap(String assemblyName, String typeName)

at Microsoft.Dynamics.Framework.Deployment.Reports.DomainBound.PrepareTask(AppDomain tempAppDomain)

at Microsoft.Dynamics.Framework.Deployment.Reports.DeployToReportsServerTask.Execute()

at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()

at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() C:\Program Files (x86)\MSBuild\Microsoft\DynamicsTools\Microsoft.Dynamics.Framework.Design.Reporting.Modeling.targets 466 6 Test_AR_SalesQuotationDrillThruReport

The current version of the visual studio that I am using is

Microsoft Visual Studio 10.0.40219.1 SP1Rel and Microsoft .NET Framework Version 4.5.51209 SP1 Rel

I tried on the following:

1.I am able to deploy the report from AX. But not on VS, which is the current problem that I am facing out.

2.I tried iisreset.Not resolved yet.

Kindly suggest me solutions on this issue please.

Thanks In Advance.

http://blogs.msdn.com/b/jaskis/archive/2010/01/05/intermittently-getting-loading-this-assembly-would-produce-a-different-grant-set-from-other-instances-exception-from-hresult-0x80131401-after-net-3-5-sp-1.aspx

Check this link and let me know if this works.

I had a similar problem. Solved by sing PowerShell.

Run PowerShell as administrator.

>Publish-AxReport -ReportName

This should sort you out.

Hi Yeswanth,

Thanks for quick response for my issue.

As you suggested the given link is related to Hotfix kb 963676. But I couldn’t install hotfix in my server, could you please provide anyother workaround solution to resolve the issue.

Thanks in advance.

Sowmya

Hi Josephat Kutieto,

Thank you for the response.I have tried your solution. Report is getting deployed using AX Power shell.

But my issue is, I need to deploy the report only from Visual Studio.Please guide me and help me is there any other way to resolve this issue with respect to Visual Studio.

Thanks In Advance,

Sowmya

Hi Sowmya,

Even I have faced same issue. After restarting SSRS services report successfully deployed from VS.

Regards,

Shiva Kumar