project references are "lost" after getting latest from TFS - visual-studio-2012

I have a solution with many projects. This is actually a solution that contains a mix of class libraries and various web applications. It seems that if my colleague makes a change to one of the web projects (or if I do) and then check it in. And then when either one of us gets the latest version project references become broken. They still appear in the references section with no indication of an error, but when you try to compile it cannot see the libraries.
To solve this I have to remove the references and add them back in. Any ideas on what may cause this problem?

Make sure that the paths are relocatable, that you both have the same paths on your PCs (i.e. that you have not used TFS workspace mappings to put different folders in different places), and that you don't move projects around or rename folders etc.
Even when everything is clean and tidy, Visual Studio will occasionally decide it can't find a file that's right under its nose, or that a file somewhere else on your system looks prettier, and it will break the reference. You just have to delete and recreate it in this case. But this usually happens once a month in a team of 10-20 people, and should not occur every time you check in.

Related

Network files randomly being affected since migrating to Windows10 with Excel 2019 and working from home

This is the first time I'm posting so I hope I'm doing it the right way.
The company I work for decided to allow work-from-home for my entire department. Ideally we would all get laptops (Windows 10 + Office 2019) to replace our old desktops (Windows 7 + Office 2010), but the change had to be done gradually and it has proven to be a nightmare.
Initially we had several different files using macros to parse XML data into excel that worked only in the old computers but not in the new ones, but with an easy fix (we changed all DOMDocuments references to DOMDocument60) issue was resolved; however, more issues started arising as soon as co-workers started getting their new laptops.
Right now our main issue is that sometimes (it seems to be completely arbitrary) files work perfectly and all macros execute well; however, as soon as another user opens that same file (files are Trusted Documents within our network) either a compile error shows - Can’t find project or library - or in most cases it doesn't but whenever a macro needs to run, file freezes and shuts down.
I have been keeping backups in my personal folder so that I can simply replace the corrupted files whenever this issues happens, but it's getting very frustrating not finding the root-cause of the problem.
Again I would share the Macro script, but as I explained is not just one file that is giving errors but multiple files scattered across the different folders of the network. Also it is not an issue that arises only when a certain user manipulates the file, but it happens with multiple users. Sometimes the file works well for user X all day, but tomorrow user X will start having issues using that same file.
I'm not sure what additional details you may require but any light either one of you could shed in regards to this matter will be greatly appreciated.
Thanks!
Ask users, when it happens to either call you to do the following, or do it themselves:
Open the VBA editor (Alt + F11)
Click Tools >> References
See which Projects or Libraries at the top of the list say MISSING
Work out why they are MISSING on that particular machine
Note that incorrect versions of seemingly the same project or library will report as MISSING if they are incompatible (as with your DOMDocument60 update). Excel will normally update a reference to a more recent version of a Microsoft Office DLL, for example, but it will not revert to an earlier version. For this reason, you should ensure that any references to MS libraries are the earliest versions you can expect to be on any of the machines being used, in your "source" (master) file.

Missing Tool References

My version of VBA seems to be missing quite a few Tool References. Therefore I tried adding a library I know exists (scrrun.dll) through the "Browse" tab although it only results in the following error:
I would appreciate any kind of help regarding how to get access to more tool references.
A reinstall may help, but these references may be pointing to a folder from a different version of windows (*\System32 vs *\SysWow64 may be the issue)
What changed from the system it originally ran on? Search the C: drive for SCRRUN.DLL and if the path has changed, switch that via browsing for the real path. I've never seen that file missing before, but I think it's part of Windows.
On a rare occasion, you may have to re-register the components (again some of these are included Windows components). Check out this reference

My APP.xaml doesn't see my Locator declaration any more, is it worth to troubleshoot or recreate solution

I have this issue that I've been spending too much time on.
Working on Visual Studio 2012, on a Windows Phone 8 app, using MVVM Light.
It's a Compile issue that just arose out of the blue. My XAML files are now invalid - but just the XAML files where I try to refer to my ViewModels (event handlers bound to buttons, etc), and the reason for that originates from my App.xaml, where it doesn't see Locator in my myapp.ViewModel namespace, so Locator is now thus seen as invalid.
I've even restored old files from a previous backup from 2 weeks ago, (after copying current files somewhere of course), and the problem still exists. Even just 2 days ago, my app is compiling great.
( btw specifically, when I say Restore, I'm only talking about restoring the subdirectory that contains all of the individual projects, under the Solution directory )
I've tried doing a Git diff, but I only commit xaml's, and cs files, so it didn't show any of my own errors that would cause this.
This seems like some problem with corruption, possibly in a V.S. binary file that I can't see, and I see myself spinning wheels, and not knowing what code to paste her in stackoverflow.
At what point do you just say : "Let's just create a brand new solution " ?
I'd hate to do that, and then the same thing happens again though next week.
However, I'm moving toward a philosophy which says: "dude, get used to doing a re-do, since this stuff happens". (I'm going to just write a Checklist for how to create a solution from new, with all the packages I need, so it's not such a bummer to start fresh.)

Migrate Visual Studio 2012 Solutions to Another Server NOT Version

Actually quite a simple issue. I have been using a slow laptop to develop on VS2012, and I setup a screamer to develop on now. No change in versions, etc., just doing it all on a different machine.
To be honest, I haven't even copied the Projects folder yet, as I'm not sure if there wold be project-specific options that would be reset/broken.
To be clear, the new 2012 is Ultimate, and I haven't even tried to migrate. There have been a LOT of options/features added to my existing projects & solutions, so it may not be as simple as copy/paste the Projects folder.
What are your thoughts?
#Peter and #JohnnyHK,
You both were right. I was putting this off on a new machine for fear that I'd need to remember a ton of things I hadn't documented in the Solution (and projects under it-about 20).
So I was already using subversion on the old machine, so I added VisualSVN/Tortoise and checked out a copy of the solution to the new Projects folder. There were like 350 errors & more warnings! Yikes!
But I went through them very quickly and it is clean now. One thing that I noticed in the process was that VS2012 is a little 'broken' when it comes to project (on-web) references. NuGet was actually amazing in that as soon as I fired up the Package Console, it went along, finding & installing all the packages & dependencies! :)
I enabled Show All Files, then opened the References tree node, and noted the ones with little yellow "X"s next to them. In the good side, ones that were not needed (I added them, but created just clutter) were good to see & delete. BUT, there were mostly errors from references that had references to DLLs that were actually in the right place, and when I left clicked on the reference with the error icon, the error would simply go away. Weird, but preferable...
The strangest ones were reference to DLLs that were where they were supposed to be (I'd make a .\lib directory in the project, a la *NIX style, and throw all DLLs for that project in there), BUT I had to delete the reference in error (even though the project was pointing to the right file/location) and then re-browse for it, adding it again, and all errors went away.
All in all, I was pretty impressed with the ease-even with the weirdness-it went. Once I saw how the references were broken, I just went into each project & treated each one. Let me be clear for anyone doing a mass WPF migration: If I had started with the first project and worked to the end one, and ONLY fixed the References issues, I would have been done in 5 minutes-includes time for NuGet to auto-load.
I will not lie; This was the first big migration of a solution to a new machine, and when I saw like 700 warnings/errors, I thought "There goes another weekend!", but I will warn those in this situation to NOT go into source code and try to fix each red underline. You will break things!

Build does not work, need rebuild

This is really frustrating, I am using Visual Studio 2012 for C++ for a project, and it worked fine for a while. Then out of the blue, it started having problems.
The build function does not update the project anymore. I need to do a REBUILD every time I modify anything in my project.
I have looked all over for a solution, but none helped. First of all, I didn't change any settings, but I looked anyway. Tools/Options/Build&Run, Project/Config Manager, you name it I have checked it. It doesn't look like it's a settings problem.
Another thing though, on other forums, I have read that this MIGHT be because of a bad include, that the file included is not there anymore, or something like that. But that is not possible either since I didn't delete any file from the project. But, this problem seems more plausible since, the project at a much earlier stage, had less includes, and it still works.
So, can you help me solve this problem? It is really annoying since most of the solutions out there are NOT working!
Whenever I have run into an issue like this it is usually something like missing project dependencies. You may want to take a look at "Build Solution" not working in Visual C++ anymore. If you are able to share your solution someone may be able to take a look at it.

Resources