ReportViewer Control Version Conflict - visual-studio

I am having a version problem with the ReportViewer Control. I am using visual studio 2010, but I think I need to use the 2005 report viewer because I am using SQL 2005. So, I set the webconfig file to point to the 2005 ReportViewer .dlls, everything works once, then VS edits the web.config to point to the 2010 versions of the dlls. Here is the relevant web config file sections set what I think is correctly:
<httpHandlers>
<add path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" />
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
validate="false" />
</httpHandlers>
<compilation>
<assemblies>
<add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
</assemblies>
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
</compilation>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd"
type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</handlers>
So, after running it and it working a few times, it automatically changes the version of the http handler to 10.0.0.0. How can I prevent this?

What is written to the web.config is defined by the references you use in the project.
In my Visual Studio 2008 project, I have the following references:
Microsoft.ReportViewer.Common.dll (Version 9.0.0.0)
Microsoft.ReportViewer.WebForms.dll (Version 9.0.0.0)
So in my config I see:
<system.web>
...
<compilation>
...
<buildProviders>
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</buildProviders>
</compilation>
...
<httpHandlers>
<add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
When I look at the available project references I have three:
Version 8.0.0.0
Version 9.0.0.0
Version 10.0.0.0
I assume this is because I have Visual Studio 2005, 2008, and 2010 installed, but perhaps installing the individual report viewer redistributables would offer the same selection:
MS Report Viewer 2005 (Version 8.0.0.0)
MS Report Viewer 2005 SP1 (Upgrade) (Version 8.0.50727.42)
MS Report Viewer 2005 SP1 (Full Install) (Version 8.0.50727.42)
MS Report Viewer 2008 (Version 9.0.0.0)
MS Report Viewer 2008 SP1 (Version 9.0.0.0)
MS Report Viewer 2010 (Version 10.0.0.0)
N.B. I've made best guesses at the version numbers; if you know better please correct me.

It is not an exact answer to your question but probably the solution.
There is no need to use older version of report viewer. It is independent on the server. Especially with .rdlc (client reports) you provide only data and report does not know the server.

It is possible to access SQL reports with a win forms app. developed using VS2010 with the ReportViewer Component Version=9.0.0.0.
Here are the steps:
To access SQL 2005 reports, you are going to have to use Version=9.0.0.0 of the report viewer component, as stated above. So you will need this in the .aspx page which you want to render the report or in a master page which it inherits:
Register assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb"
And this
<form id="foo" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<rsweb:ReportViewer ID="ReportViewer1" runat="server" ProcessingMode="Remote" Width="950px"
Height="600" BorderColor="Gainsboro" BorderStyle="Solid" BorderWidth="1px">
<ServerReport ReportPath="/foo/foo/FooReport"
ReportServerUrl="http://foo/ReportServerSQL2005" />
</rsweb:ReportViewer>
…
You might have to change references to any other version of the ReportViewer Component in the web.conig as well because VS2010 and newer versions are going to default to new versions of the ReportViewer Component
e.g.
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
Change to
<add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
Just search the entire solution for Version=8.0.0.0 and Version=10.0.0.0 etc. and make changes to both the Version= and PublicKeyToken=
You are also going to need a reference in your project to the reportviewer component 9.0.0.0, from the .net tab and remove any references to any other version.
It’s worth noting that when using .aspx pages which have both source and design views in VS, it will say Error Creating Contol – ReportViewer1, in the Design view. From what I have read, this is a bug with the component but it works anyway in all major browsers.
Also, if you are going to drag the component from the tools onto the design surface, you are most probably going to need to add the 9.0.0.0 version and ensure that it is this one that you use.
I previously answered this question here:
http://forums.asp.net/p/1985629/5691326.aspx?VS2010+ReportViewer+with+SQL+2005
However, my application is .NET 3.5 MVC2 application but I was still able to get it to render SQL2005 reports, after some considerable effort.
Ideally you should update your 2005 SQL report services to 2008, however, make sure that everything still works by creating a copy/backing up first because there is no going back. Once you have achieved this, all of the above becomes unnecessary, for us this was just an interim solution.

Related

VIsual Studio 2019 Entity Data Model Wizard AssemblyFile is null

I've created a WebSite Project in Visual Studio 2019, but when I try to add an ADO Entity Model and I click on New COnnection, Visual Studio raise an error:
assemblyFile is null or empty
at Microsoft.Data.Entity.Design.VisualStudio.ExecutorWrapper...
After clicking on Abort, the only button that can close the error window, VS crashes.
I've tried to reinstall everything from scratch several times, I've installed also on another PC but the error persists.
The reference to the assembly System.Data.Entity is in the webconfig:
<compilation debug="true" targetFramework="4.7.2">
<assemblies>
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
Anyone knows how to solve or Database first in EF6 must be forget??
This happen to me on a website project. I change it to use Web Application project and now EF works fine. Try that.

Browser Link Dashboard on Visual Studio 2013 RC

I installed Visual Studio 2013 RC on Windows 7. I want to work with Browser Link Dashboard. But It isn't working. It shows that No Browsers Connected in the Refresh link. What should I do? Please Help
to me what worked
<system.webServer>
<handlers>
<add name="Browser Link for HTML" path="*.html" verb="*"
type="System.Web.StaticFileHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
resourceType="File" preCondition="integratedMode" />
</handlers>
</system.webServer>
You need to be debugging a project that includes the right HttpModule for Browser link to work.
It is mentioned in this post.
An MVC project and Web forms will include the HttpModule that inserts the required JavaScript code into your pages for Browser link to work.
You can check that the bottom of your page have the following (view source):
<!-- Visual Studio Browser Link -->
<script type="text/javascript" src="/__vwd/js/artery"></script>
<!-- End Browser Link -->
An empty ASP.NET project does not work out of the box.
Copying the following from an MVC project into the web.config of an empty ASP.NET project will insert the magic JavaScript, but it will also stop your page from displaying. Not sure how to just get the HttpModule that is needed and not the MVC view blocking. Visual studio will report that the browser is connected though.
<system.webServer>
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
</system.webServer>

ReportViewer not working on Visual Studio 2012

I just adquired the VS 2012 and I tryed to open my projects I made using VS 2010.
But now, the ReportViewer is not working, it shows up but with NO DATA.
my code are OK, my querys are OK, everything about this are OK, I'm sure !!
Because it's not working only now in the Visual Studio 2012, anyone would know what could I do ?
I tried to remove some lines from my web.config:
<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
<add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>
I also tried to delete my current ReportViewer and Create a new one, didn't work neither...
Obs: I'm not posting any code here because I have no need to correct my code, it's ok, I'm sure ! I just need know why it's not working on VS 2012.
Make sure you have updated your aspx page hosting the reportviewer with the reference to the version 11.
<%# Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

Strange error in using ErikEJ's SQL CE Membership provider

I've been trying to implement the wonderful SqlCe 4.0 Membership Provider by ErikEJ but I'm having trouble. I got it working via the documentation mr EJ provides. But....
I want to abstract the source into an external DAL. But I'm having issues getting there. The first problem I'm getting is trying to add the reference to SqlCe via the .csproj file rather than the web.config. (I need to do this so I can add the same reference in my DAL project) (I also need to be able to set copy local to true so want it in the csproj references). So I do this....
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<!--<add assembly="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91"/>-->
</assemblies>
And then add it in my project...
But when I browse to the website I get this error message:
Unable to load the native components of SQL Server Compact
corresponding to the ADO.NET provider of version 8482. Install the
correct version of SQL Server Compact. Refer to KB article 974247 for
more details.
When I refer to the KB article it says:
FIX: You receive an error message when you run a SQL Server Compact
3.5-based application after you install the 32-bit version of SQL Server Compact Edition 3.5 Service Pack 2 on an x64 computer
And yeah that's whats throwing me. Why is it talking about 3.5? I have added a reference to the 4.0 dll which Eric's provider is designed to work with.
I really hope someone can help. Perhaps Erik will read this post :-)
p.s. I'm also wondering what the difference between adding a reference in the web.config and adding it it via the csproj actually is. I thought it was because the web.config looks in the GAC. But when I try to add a reference in visual studio (to the csproj) i cant see the option to add System.Data.SqlServerCe at all!
I can also say that when I copy the dlls directly from
C:\Program Files\Microsoft SQL Server Compact Edition\v4.0\Private
Into my DAL bin and website bin and reference them directly in the CSproj I still get the same issue.
You are using the Private assembly version (4.0.0.1) - sounds like the required unmanaged DLL files are missing from your deployed site. Could you have a look in file explorer and show what you see.
Also, see this SO answer: Can't get sql server compact 3.5 / 4 to work with ASP .NET MVC 2

System.Linq namespace missing even with reference to System.Core.Dll

When I open up a Asp Net web site of mine in Visual Studio 2010 the properties say "Target Framework 3.5", however when I try to using the Linq namespace the compiler complains about it.
"The type or namespace name 'var' could not be found (are you missing a using directive or an assembly reference?)"
"The type or namespace name 'Linq' does not exist in the namespace 'System' (are you missing an assembly reference?)"
I manually referenced some dll's to fix my problem, but still no success.
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
Help? :-)
If you can't even use var, that suggests it's not even using the right version of the C# compiler. (You should be able to use var even when targeting .NET 2.0, so long as you're using the C# 3 or C# 4 compiler.) I would concentrate on getting that working first before anything else.
Is it possible that you're running on IIS but don't have that configured appropriately? It might be worth looking at your website configuration around that side of things, and possibly rerunning aspnet_regiis.
I just fixed a similar issue adding a targetFramework="4.0" attribute to the compilation element in web.config
The modified relevant fragment is:
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>

Resources