I downloaded a VS2013 project from a Git repo. The repo does not include the assembly references inside it. However, I have the SDK that contains all of the references I need for the project. The problem is that the path for the references is empty. Currently I'm having to remove and re add each assembly one by one and it is wasting too much time.
Is there a way to set a path to the folder that contains all the references and have the VS project find and update them automatically?
Related
I have a Visual Studio solution, containing multiple projects. To some of these projects, I had referenced a Shared Project, which has since been deleted. However, the Visual Studio project seems to still be referencing this deleted Shared Project.
A specific type I am using is present in both the Shared Project and a referenced NuGet package. Even though there is no sign of the Shared Project anywhere in the dependencies, I still get an ambiguous type error. Furthermore, when using Intellisense autocomplete in the project's .cs files, the Shared Project will be autocompleted. However, when I search through the entire solution by the Shared Project's namespace, there are no results. What's even more strange, is that the entire folder the Shared Project was in, has since been deleted. The files are literally not on my disk anymore.
I have tried deleting all bin and obj folders, as well as the .vs folder, but nothing changed.
It seems this shared project is also referenced by a NuGet package I am using. In the latest version, this shared project is (obviously) deleted, but in the old version it is still present. This was the cause of my issue. I have updated the package and now everything is fine. Thanks for the input.
I have this dll (Microsoft.web.Infrastructure.dll) in many project's package.config of my solution. There are no build errors and the dll is getting downloaded to Solution's packages folder.
I am getting runtime error on missing dll on each of the project the application hits. When I look at the individual project bin folder, I don't see this dll copied. However as I mentioned earlier the dll is downloaded to packages folder of solution.
Temporary Solution -
Manually copy this dll to all individual project bin
Place this dll in GAC
This problem is only on my machine and not on any other colleague's machine. Surprisingly some of them have this dll copied into project folder while some of them don't. It works for them without this dll in GAC and without any manual effort, a clean rebuild did everything for them.
I have a short term fix but I am more curious to know how it working on other machines and what I am missing.
Things that I have tried so far -
Clean Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root....
Clean solution and close reopen solution and finally Rebuild solution
Visual studio 2015 doesn't have clear nuget cache as compared to visual studio 2013.
FYI - I have Visual Studio 2015 and all other machines are on 2013, if not something else this is where I am looking at now.
Any help is appreciated.
Please check whether the Microsoft.web.Infrastructure.dll is exist in the Project References. If not, please try Win’s suggestion to reinstall your package in the Package Manager Console by following command:
Update-Package –reinstall Microsoft.Web.Infrastructure
Because the NuGet Restore only restores packages based on the package.config file to the packages directory, but does not add the reference to your project by default. So we need to force reinstall the package to add references and content files into project.
If the dll is already existed in your Project References, you need to check the property value of “Copy Local”. The Copy Local property determines whether a reference is copied to the local bin path. The CopyLocal=True should be set if the reference want to be copied to bin folder. See Set the Copy Local Property for more detail.
I found that my team used to have dll's in the bin folder but wasn't checked in, but the project file still had references pointing to those deleted dll's. What happened was I still had those dll's in my bin while nobody else did, and those dll's depended on microsoft.web.infrastructure existing, so I was the only one getting that error.
For me, those dll's (references) were:
System.Web.Razor
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
So instead of modifying references in the the project file (It'll be on a different check in), I just deleted those dll's in my bin, and no more dependencies on microsoft.web.infrastructure.
I have multiple base console projects nested within a single solution in Visual Studio. Each project creates a reference to the same base dlls.
How can I create a centralized references or lib section so that all projects within the solution can reference that centralized location without having to duplicate the same base references to the same dlls over and over again for each project?
From your screenshot, most of your References appear to be .Net Framework Class Libraries. You don't have to worry about those.
If you are re-referencing the same custom libraries, it is better to include the Library's source as a Project within your Visual Studio Solution and add Project References to that Project in every other Project where it is needed.
Example: Adding a Project Reference
If you don't have access to the source code of some of the custom libraries, then what I usually do is, create a \Libraries folder at the root folder of the Solution Source folder, and add file references to the individual DLLs from the other Projects within the solution. This way, if 1 or more of your DLLs gets updated / upgraded, you just replace the copy in the \Libraries folder and all your referencing projects will point to the latest version.
You cannot avoid having to reference those libraries from each individual project. But if you are looking to do the same references for a large number of projects - or if you just have some favourite references you want added to each new project you add - then Visual Studio has that capability - it's called a template project.
Create your project the way you want it (it will most likely be a class library, although you can do a UI based one as well), then click File->Export Template, which brings up the following wizard:
Then the next time you go File -> Add -> New Project your new template will be listed just like my example on here:
If you already have a whole lot of established projects that you want to add the same reference to (and it isn't available as a nuget package so you can't use the nuget package manager), then there is a more hardcore way. Visual Studio project files are XML, so you can right click on a project in your Solution Explorer, select Unload Project, then right click again on the project and select Edit to open the project file as XML. You can then copy paste the Reference nodes containing the references you want to propagate. Do be careful to adjust any relative paths where necessary.
If you need to do this in a bulk way then open the project files in Notepad++ and do your copy paste operations.
You can't escape it. You need references in your project, you will have to reference them. If you have third party dlls then you can put them in a single folder and reference them in desired projects from there.
I created a new assembly name for one of my projects and must update my DLL files to reflect that. In Visual Studio I can clean the solution and then rebuild to do this locally. From there I must deploy my solution to a server for testing. When I deploy, the DLL's are not being updated on the server and I cannot figure out what is going on. In my build definition I do have 'Clean Workspace' set to all, so I thought it should update.
The solution is under source control and the DLL files are included in the bin.
I can also copy them manually, but I am not sure how to view the DLL files on the server.
Thanks!
I'm working on a Web Application in Visual Studio 2012 using HtmlAgilityPack. My project references the 1.4.0.0 version of the dll in the application's bin folder. Previously it used 1.3.0.0
The application works, but about once a day the dll in the bin folder is overwritten replacing version 1.4.0.0 with 1.3.0.0. I've already checked the GAC and deleted my ASP.NET temp folders the first time this happened. Does anyone know what's going on here?
You need also delete the 1.3.0.0 dll from you solution's reference list from Solution Explorer.
The older .dll is apparently being referenced from somewhere within your solution. I would open the project file(s) in an editor and look for any references to older versions there.
If none are found, my guess would be that some other library or component you are relying on is referencing the old version of the .dll (are you using any third party libraries?). If you don't have the source for these, then perhaps you can decompile them using JustDecompile or some similar tool. Then you can at least check the references within the dll's your using, and confirm or rule it out as the source of your problem (no pun intented ^^).
Oh, and one more thing - maybe obvious, but have you set Specific version = true for the reference?