Can't preview SSRS 2008 report - reporting-services

I'm trying to develop some SSRS reports in VS2008 and when I preview them I receive the following error message:
Failed to load policy file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\RSPreviewPolicy.config
This method explicitly uses CAS policy, which has been obsoleted by the .NET Framework. In order to enable CAS policy for compatibility reasons, please use the NetFx40_LogacySecuirityPolicy configuration switch. Please see http://go.microsoft.com/fwlink/?LinkID=155570 for more information
In order to attempt to resolve, I have added the following toe my RSPreviewPolicy.config file
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>
However, I have rebooted my machine and this didn't take care of it. Any other ideas?

I found it... I need to add
<runtime>
<NetFx40_LegacySecurityPolicy enabled="true"/>
</runtime>
to the C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe.config file not the C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\RSPreviewPolicy.config
Once I did that and restarted VS2008 it worked fine

Related

Unable to build SSIS package from command line: Missing switch argument. Configuration name required for /build switch

I am trying to script out the building of an SSIS solution in VS 2013.
I keep getting the error: Missing switch argument. Configuration name required for /build switch.
My Command is this from PowerShell:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE> .\devenv.exe C:\Dev\SSIS\RCLShippedFileProcess\RCLShippedFileProcess.sln /build /project RCLShippedFile /projectconfig "Debug"
When I build within Visual Studio, I can see that my ProjectName and the Config are what I am passing in. This certainly has me stumped!
Documentation about this is here.
I ended up resolving the issue, I needed to call the devenv.com application, which is ultimately what devenv.exe calls. If you call devenv.com directly it worked.
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE> .\devenv.exe C:\Dev\SSIS\RCLShippedFileProcess\RCLShippedFileProcess.sln /build "Debug"

Error: Could not load file or assembly Microsoft.AnalysisServices.AdomdClientUI

I am newbie at analysis services. When I try to execute ssis package on command prompt with dtexec command, I get the error :
Could not load file or assembly Microsoft.AnalysisServices.AdomdClientUI.dll Version 13.0.0.0
I tried few solutions which I found internet but they didn't work.
Thanks for advice.
Edit 20180604: Cumulative Update 1 for SQL Server 2016 SP2 fixes the issue.
Pre-20180604 answer: There's now a workaround for this bug, published here:
There is a bug, it will probably be corrected in SP2 CU1 which I've
been told will be released at the end of the month. We got a
workaround suggestion from MS, but that was not enough.
In short: The provided workaround does not work as is, but I found out
what more to do so now it works on the server with SP2
Longer: The provided workaround does not work as is because it does
register the correct assembly and the correct version (v14), but when
the package is run it will still search for the previous version v13. I
have tested and this is the case even if I have SP2 on my laptop,
rebuild all in the SSIS project and deploy – it will still be v13 that
is search for. It does not help to register v13 of the assembly, since
that version does not have a method that is called, so that will just
lead to other error messages.
The resolution I made on the server is to put in a binding redirect in
the .NET machine.config so that v14 is used even though v13 is searched
for.
Step-by-step I did, run from an elevated CMD:
1: Register the assembly: "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe" /i "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\Microsoft.AnalysisServices.AdomdClientUI.dll"
You should get message one assembly successfully registered in GAC.
2: (Optional) Verify registration:
"C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe" /l Microsoft.AnalysisServices.AdomdClientUI
You should see message it is version 14.0.0.0 registered
3: Configure version redirect in machine.config (be careful when
editing!!)
File to edit:
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config"
The element to add content to is
configuration/runtime
On the server I fixed it on, this element was completely empty, i.e.
<runtime/>
If it is not empty, of course keep what’s in the element and add the
assemblyBinding element seen below.
Change/add so that the whole element contains this instead:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.AnalysisServices.AdomdClientUI"
publicKeyToken="89845dcd8080cc91"
culture="neutral"/>
<bindingRedirect oldVersion="13.0.0.0"
newVersion="14.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
5: Save the file. The package should now work.
When a fix in CU1 is installed, these steps should be done:
1: Remove the above added assemblyBinding element and save the file
2: Remove the dll that was added to the GAC: "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe" /u Microsoft.AnalysisServices.AdomdClientUI
In my server, "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies\Microsoft.AnalysisServices.AdomdClientUI.dll" was version 13, so in step 1 v13 was being registered (you can check the version by right clicking/Properties and then clicking on Details tab).
To solve this I:
Unregistered v13 with "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe" /u Microsoft.AnalysisServices.AdomdClientUI
Copied v14 from a computer with VS installed to "C:\Program Files\"
For step 1, I executed "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe" /i "C:\Program Files\Microsoft.AnalysisServices.AdomdClientUI.dll"
The steps when the fix arrives remain the same (with the addition of deleting "C:\Program Files\Microsoft.AnalysisServices.AdomdClientUI.dll").
Note: if you're running your packages in 32-bit instead of 64-bit, the machine.config that needs to be edited is the one located at c:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
SQL_AS_ADOMD.msi includes Microsoft.AnalysisServices.AdomdClient.dll, but not Microsoft.AnalysisServices.AdmomdClientUI.dll.
Microsoft.AnalysisServices.AdmomdClientUI.dll is included in SQL Management Studio, but version 13.0.1700.441 that I had as a drop in replacement failed due a new method being invoked, and I have not been able to locate a matching SQL 2016 SP2 version. Presumably awaiting a hotfix from Microsoft now.
You can get the Microsoft.AnalysisServices.AdomdClientUI.dll from MS SQL Server Feature Pack component SQL_AS_ADOMD.msi.
Presumably you have SQL server 2016, so you can get it from the SQL 2016 Feature Pack.

Visual Studio 2017 SSRS Report Templates

With the version of SQL Server Data Tools included with SQL Server 2012 you could create a report definition and copy the .rdl into the folder below and it would appear when you created a new project item.
C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject
I'm trying to achieve the same with Visual Studio 2017 and the Report Project extension though this does not appear to work when I copy the file to the folder below:
C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\IDE\PrivateAssemblies\ProjectItems\ReportProject
How can I get template report items to appear for report projects?
The new location is now under (replace Enterprise with whatever your sku is)
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSDTRS\ProjectItems\ReportProject
UPDATE: This now looks to have changed to
C:\Program Files (x86)\Microsoft Visual
Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS\ProjectItems\ReportProject
It looks like the folder path has changed now that SSDT is no longer in Preview - it was released 4-10-2018 for the first complete release. Anyways, I had an SSRS template that disappeared after installing the new release. Upon inspection, I found that the folder path for SSDT templates was moved from the Enterprise to SQL paths (remove the spaces):
SSAS: C:\Program Files (x86)\Microsoft Visual
Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSAS\
SSIS: C:\Program Files (x86)\Microsoft Visual
Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSIS\
SSRS: C:\Program Files (x86)\Microsoft Visual Studio\2017\SQL\Common7\IDE\CommonExtensions\Microsoft\SSRS\ProjectItems\ReportProject\

SSRS Custom Assemblies could not be loaded under Visual Studio 2017

I have just installed VS 2017 and moved my SSRS project from VS 2015 to 2017. I have a custom assembly which is working fine under VS 2015, but not 2017. It says
Error while loading code module: 'CustomLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Details: Could not load file or assembly 'CustomLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
I had exact same problem under VS 2015 and the solution was moving my custom dll under
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\PrivateAssemblies
So, I have moved my custom dll under
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies
which I believe is the correct path for VS 2017 and check file/folder permissions and set them identical, but no way, it still throws same error.
What am I missing?
This now requires two locations for the dll - the first works for new VS2017 RS projects, but upgraded projects also need the dll in the second location:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSRS
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PrivateAssemblies
I too have run into this issue, what fixed it for me was doing what was mentioned above and also editing the RSPreviewPolicy.config located in
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsof‌​t\SSRS
I set PermissionSetName="FullTrust" in all of the < CodeGroup>< /CodeGroup>
blocks.
TLDR - C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSDTRS
I was having the same problem - try using the Fusion Assembly Binding Log Viewer to peer into what the problem is as per http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx
With "Log bind failures to disk" enabled (and restarting VS) the devenv.exe process folder in your log location should then produce log files when you recreate the problem. Part of what it will tell you is the various folder locations VS is checking for assemblies. My issue was that I hadn't copied a required assembly. You might also be having a problem with it not liking a specific version of a dll it is trying to load (for instance .Net 4 v 2), the logs will highlight that as well.
The viewer tool is pretty poor in terms of being able to sort columns. I found it much easier to just open C:\FusionLogs\Default\devenv.exe (where I had set C:\FusionLogs as the custom log path), sort by date modified and watch as new files were created when trying to add the data source.
In terms of which folder to use - I initially dropped them into PrivateAssemblies which worked for creating the data source / reports. However when it came to build the preview the report I then got another could not load assemblies message. Again using the log viewer, but this time in the PreviewProcessingService.exe folder the error suggests the only directory that checks for the assemblies is: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\SSDTRS - this location works for both creating and previewing reports.

Could not load file or assembly error on adding custom libraries in SSRS reports

I have created a custom library(CodeLibrary) which internally references the dlls Microsoft.TeamFoundation.Client and Microsoft.TeamFoundation.WorkItemTracking.Client.
I added this custom Dll codelibrary.dll to my SSRS report. and the expression of one of the field as
=codelibrary.codefunction.GetValue(1000)
codefunction is the class and GetValue is the method.
When I preview the report, I get the error "Error while loading code module: 'CodeLibrary,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null'. Could not load file or assembly 'CodeLibrary,Version1.0.0.0, Culture=neutral,PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
I am using VS2013, I have placed the custom library DLL in the path
C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies
I have tested the custom library with a WPF application and it works fine.
I am not able to figure out what is causing this error.
I didnt have to modify rssrvpolicy.config file.
I added the custom dll to the following paths and it worked:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PublicAssemblies
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies
C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin
In visual studio 2015, I had to copy the dll to:
C:\Program Files (x86)\MSBuild\14.0\Bin
You should copy your custom library to the ReportServer\Bin folder ex: C:\Program Files\Microsoft SQL Server\MSRS10_50.R2\Reporting Services\ReportServer\bin
Then modify the rssrvpolicy.config in ReportServer folder, find "$CodeGen$" and add the following code
<CodeGroup
class="UnionCodeGroup"
version="1"
PermissionSetName="FullTrust"
Name="CoDeMagSample"
Description="CoDe Magazine Sample. ">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSRS10_50.R2\Reporting Services\ReportServer\bin\YOURLIBRARY.dll"
/>
After that, Stop and Start Reporting Service from Reporting Service Configuration Manager.
Hope this help.
Adding - In Visual studio 2019, I copied the dll to:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS