Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 20, 2012 09:13 PM by radman38654
Jul 13, 2010 03:30 AM|LINK
I keep trying to add an assembly reference to my website which doesn't show up anywhere in my code. Specifically, I would like to add a reference to System.Xml.Linq.dll to my website. No such reference appears in my web.config file. Also, when I right
click on the website in the Solution Explorer window, go to Property Pages, and then click on References in the left-hand column, System.Xml.Linq does not appear. Yet, when I right-click on the website and go to add reference, I ultimately am met with the
"The website is already referencing the assembly 'System.Xml.Linq'"
Also, when I put a using statement at the top of one of my classes in my App_Code folder for the System.Xml.Linq namespace, the Visual Studio IDE does not flag it as an error.
Any insight into this strangeness would be very much appreciated. I'd like to put this into production someday, and I'm worried it might not work due to a missing reference. The version I'm currently using is Visual Studio 2010 Professional Edition.
Thanks in advance to anyone who has any ideas!
Jul 13, 2010 05:41 AM|LINK
right click your solution >> Clean,
then rebuild , see if it works, if not then add righ click website Bin>> Add references >> .net refs add the assembly which you want
Jul 13, 2010 07:04 AM|LINK
try restarting the system..
Jul 13, 2010 12:15 PM|LINK
Hi Nizam, thanks for the reply. I am unable implement your suggestions, though. When I right-click the solution, there is no option for "Clean". It also doesn't exist on the main menu under "Build". Also, I tried right-clicking the website in the solution explorer,
but there was no item for "Bin". There was an item already there for "Add reference", which I tried, but still I was met with the same problem.
Jul 13, 2010 12:18 PM|LINK
I've tried restarting several times, as well as shutting down and restarting my computer, but to no avail. The problem persists...
Jul 13, 2010 03:39 PM|LINK
hy i think you have tried all options,
Try to create a new project and then try to add same reference, are you still getting same problem if yes then you might want to repair your visual studio from control panel>>Add remove programm
other wise there should be some problem with your project, you need to look into project properties,
Jul 13, 2010 06:30 PM|LINK
Thanks Nizam, that was a good point about trying to recreate the problem in a new website project. After doing so, I noticed the same phenomenon in the new and empty website. I've concluded that I must be missing something concerning how visual studio
keeps track of references to assemblies. The reason is that in the "Class View" window [View -> Class View from the main menu], I just found a folder named Project References. This folder does indeed contain a reference to System.Xml.Linq, something which
I did not notice earlier. I am still unclear as to why the references in this folder do not show up in the web.config file. But at least I was able to find mention of System.Xml.Linq somewhere in the IDE. Thanks again for all of your replies!
Aug 30, 2010 05:45 PM|LINK
I am having a similar problem with reportviewer dlls while trying to upgrade from a framework 2.0 site to 3.5; I'm running Windows 7 and VS2010 so I can't use the reportviewer 2005 references...since class viewer is the only place I'm finding the references--what
did you do to remove them?
Aug 31, 2010 11:19 AM|LINK
Ejo, I don't think I ever removed the references from my website. I just wasn't able to understand why the reference was showing up in the Class View but not in my web.config file. For me, the reference to the assembly in question still exists in the Class
View of my website...
One thing to note is that when I started working on my website, I went to File > New > Website and chose ASP.Net Empty Website from the dialog box. So I don't have a reference to Microsoft.ReportViewer.WebForms.dll in my Class View. I'm not sure what would
happen if I chose a different Website type from the dialog box, such as ASP.Net Reports Website... Perhaps this is configured in the solution or project file, somewhere...
Hope this helps!
Aug 31, 2010 02:32 PM|LINK
Thanks for the reply, Andrew.
As it happens, I had started out by using the regular asp.net web site, but have since gone and created an empty site as well. At first, I just wholesale copied my files into the empty site and was still unable to add the references--so I thought "ah ha!"--some
where burried deep in one or more of those files is where the problem is. I built another new empty web site and added files/folders one at a time adding the references as I went. I got all my necessary files and folders copied and was able to add the references.
What I thought peculiar was that the only item that did not get copied was the default Scripts folder that was added when I had created the regular site. In it are 3 default jquery-blahblah.js files...which I did not care to investigate further as this site
does not use jquery.
So the references are added, but the homework has only just begun. I now get this error:
Warning 30 C:\inetpub\wwwroot\WebSite1\Reports\WorkLists\AssetsMoved.aspx: ASP.NET runtime error: Could not load file or assembly 'Microsoft.ReportViewer.ProcessingObject' or one of its dependencies. The located assembly's manifest definition does not match
the assembly reference. (Exception from HRESULT: 0x80131040)
Sometimes I don't know what's worse...no google hits on a query, or so many you'll never be able to read through them all. The down side is that there are apparently TONS of folks who have this error. The bright side is that there are apparently TONS of
folks who have this error.
Maybe when you go to clean up your references this might be helpful.