Opening a solution from TFS - tfs

I'm working on a project in Visual studios 2013. I was trying to figure out how to do something and was recommended to look at another project on TFS that does something similar. When I got latest version of this other project, I found out it was made in VS2010. It migrated it to VS2013, and locked the file to me. I undid the changes because I don't want to modify this other program. I was unable to find a way to open that file without it trying to lock the file to me with migrating to VS2013.
As an attempted solution, I copied the file elsewhere on my computer and tried opening it without connecting to TFS. I assumed this would allow it to migrate to 2013 without updating the database. It still had issues and gave me this error: Solution file '%s' cannot be migrated because the solution cannot be checked out from source code control. To migrate the solution, make sure the solution file can be checked out and re-open it.
How can I open this solution without updating the TFS solution and locking the file to myself?

I just ran into this same problem. I checked the permissions on the solution files I was trying to open and saw that it was set to 'read-only'. I deselected read-only and the solution opened.

If everyone else is using VS2010 with Service Pack 1, then upgrading the solution isn't a problem. People will still be able to open it in VS2010 SP1, even if you check it in. See the Visual Studio 2013 Compatibility notes on MSDN for specific things to watch for.
Alternatively, after checking the files out but before opening the .sln file, create a copy of it in the same folder calling it MyProject2013.sln (for example). Add this new solution to source control using Source Control Explorer and then open it, letting Visual Studio upgrade the .sln file as it would normally. The 2010 .sln file will be left untouched and you should be OK to do what you like with the 2013 solution.

Related

Can't run solution from TFS as all references are missing

I have a project which works fine. This morning, I created a new TFS project and published all the code from Visual Studio 2015.
On another computer, also via VS2015, I've logged into Visual Studio Team Services to grab the same project and downloaded all the code
When I try to build, there are over 100 errors, but the cause appears to be the same. It can't find resources, and the error messages all appear to be
The type of namespace name 'some name' does not exist in '....' (are you missing an assembly reference?)
So, I expand the References and I'm missing pretty much all of them. In fact, other than the references within my own project, the rest are not there
Looking at the properties shows no path. Back on the original PC I see the path to any of the .dlls is similar too
C:\Users\Me\Documents\Visual Studio 2015\Projects\MyProj\ToT\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll
Is the issue that since this path doesn't match on the 'faulty' machine it can't show... Therefore what is the solution to this
I checked and noted that the files do appear to exist when I look at them in File Explorer.
All system references missing Visual Studio 2013 NuGet Async did not help
Please note, this happens with all projects in my solution, but not consitently. For example, EntityFramework is missing from all, but System is missing from my UI layer, but not from my BLL layer
Is there a way to fix this?
You need to run the update-package -reinstall command to reinstall all referenced packages.
I had the same problem, there are lots of answers by now but I will still post it here:
1.Close Visual Studio
2.Manually delete the local “packages” folder
3.Reopen the solution, and rebuild. (Nuget should restore the packages)
Source:
http://robertgreiner.com/2013/09/team-foundation-service-build-error-nuget/
Go to TOOLS -> nuget package manager -> package manager console -> and run to the console : UPDATE-PACKAGE -REINSTALL .
Clean your solution, rebuild and you are ready!
Sounds trivial but your missing references to system.xxxx could imply a problem with the .NET Framework, what version are you using and is it installed properly on your 'faulty' machine. Might be worth a re-install/repair? I'd check what versions are actually referenced too.
As for NuGet, make sure that Enable package restore is set as:
Also, I had a problem similar to this once and I had to upgrade the NuGet package manager to version 3 in Tools -> Extensions and Updates (You need to uninstall and then re-install as update won't work)
Finally if that doesn't work, check in File Explorer in the packages path and delete all packages. They should not be included in source control as this is what NuGet will download. If they are there or partially there, sometimes it will not download them.
Verify the .NET version:
Open the project properties pane and check the Target Framework:
Ensure this version of .NET is installed. OR change the target framework to a suitable version
First, go to VS--Tools--Extensions and Updates to check whether there are updates, install all updates. Then select one reference with a warning icon, check the Specific Version property, if the value is True, change it to False.
If the issue persists, check the Reference Assemblies of .Net framwork on your two computers, to see whether they are under the same location (the .Net framework is supposed to be under *C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework*).
=========================================================================
11/5: To avoid references missing, you can either check in all references to source control and reference from the source controlled ones, or use Nuget Package Manager to install packages. The previous is not recommended now, try Nuget Package Manager.
Before hitting your head against the wall with the million of Nuget 'fixes' you need to make sure you are getting ALL the DLLs that are in your Bin folder under source control. For some reason a simple "Get Latest Version" is not enough. Visual Studio will keep telling you all files are up to date but apparently this doesn't mean all the files under source control are downloaded (or it does and what happened to me is just a sassy bug). Anyways, to make sure you are truly "getting all" you need to force an update by using the "Get Specific Version" command with the "Overwrite all" option checked as VS suggests. To do this:
Go to your Bin folder in Source Control Explorer (Or w.e folder you truly want to get all)
Right Click > Advanced > Get Specific Version
Check the "Overwrite all files even if the local version matches the specified version" checkbox
Click Get
By doing this I ensured all the referenced DLLs were downloaded from TFS and for me that solved the problem. I'm using Visual Studio Enterprise 2015.

Can't have Nuget.config in source control?

In one of our projects, I've recently converted from the (now broken) old-school MSBuild based automatic package restore to the shiny new automatic package restore in Nuget 3.0 (Visual Studio 2015 RTM default).
As the official guidance suggests, I have created a .nuget/Nuget.config file in the solution folder to stop it from uploading the binaries. No more clutter in source control. Life is good.
However, this doesn't work on other machines if the Nuget.config isn't itself included in source control, so I have done just that. Now life is bad again.
Visual Studio can't load Nuget correctly and the error log indicates that it can't open .nuget/Nuget.config read-write. Which is fair enough, since it's under TFS source control and not checked out.
So here's the question: How to have my cake and eat it, too?
Upgrade to Nuget 3.1.1, it behaves as expected and doesn't open the file read-write.
Delicious cake.
The discussion for this (closed) issue is here: https://github.com/NuGet/Home/issues/1103.

Importing an UMBRACO site into Visual Studio

Is it possible to import an already existing Umbraco site into Visual Studio? (By means of getting all the site files and DB backup)
I've tried creating an empty project and copying the website files, but I get several errors when I try to compile the solution. The errors look like "Could not find scheme information for the element 'umbracoConfiguration'."
The same happens if I create an empty solution, add the UMBRACO nuget package, and then copy the website files.
I'm wondering if it is at all possible, or if once an UMBRACO website is running, how should one customize/develop on it?
THANK YOU!
After several attempts and trial and error, as well as reading other blogs, the way it worked for me was to go in Visual Studio -> File -> Open -> Web Site... and select the main folder containing all the files.
It is important to know that the web.config had to be modified in advanced for the website to work to point to the local server and off course attach the DB to the local SQL server.
Everything works perfectly just the way it was working on the host, and I have the solution in Visual Studio.
I like to start with nuget because it handles setting up all of my project references. I create a new MVC4 Web Application
Visual Studio->File->New->Project->MVC4 Web Application
After I create the new application, I open the Nuget Package Manager Console
Tools->NuGet Package Manager->Package Manager Console
I then enter the command:
Install-Package UmbracoCms.Core -Version 7.2.1
I find that installing the UmbracoCms.Core instead of the whole UmbracoCms nuget package is best because it only sets me up with the umbraco dlls and sets up the references for me. The UmbracoCms nuget package tries to do a lot more and is more handy if you are setting up a brand new umbraco site in Visual Studio.
Once I have nugetted the appropriate version of umbraco, I copy my existing umbraco site files over the files that were nugetted. When you copy all of the files over, don't copy all of the App_Data. Most of the files in that directory are TEMP files and cache files. From App_Data, only copy the following. This will save you time reindexing the site. I suspect a lot of the App_Data files were responsible for your Object Null Reference.
App_Data/access.config
App_Data/packages/*
In visual studio, in the solution explorer, click "Show All Files", and then include the appropriate files in the solution. Rebuild the solution, and you should be set up for development.

VS2012 ProjectTypeGuids Lost when opening after installing ASP.NET and Web Tools 2013.1

I've installed the "ASP.NET and Web Tools 2013.1" in my Visual Studio 2012.
I have a solution which has an ASP.NET MVC 4 project with the following project type guids:
<ProjectTypeGuids>
{E3E379DF-F4C6-4180-9B81-6769533ABE47};
{349c5851-65df-11da-9384-00065b846f21};
{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
</ProjectTypeGuids>
These Guids are for:
ASP.NET MVC 4.0
Web Application
Windows (C#)
This is the usual configuration when you create a new ASP.NET 4.0 project. And it works fine.
The problem is that, for some strange reason, whenever I open my solution the first GUID (ASP.NET MVC 4.0) is deleted from the .csproj file, so I lose all the related tooling.
No matter how I try to edit it:
if I close the solution, and edit this file manually, adding the missing GUID, when I open it again, the GUID is deleted
if I unload the project, edit the .csproj and reload it, the GUID is also deleted.
I have this project under version control (SVN), so I have also tried closing VS, updating the file in the SVN (using Tortoise) and reopening the solution. And you know what? The GUID is deleted when opening the solution !!!
If I create a new solution with an ASP.NET MVC 4.0 project, it works fine, and the GUIDs are kept.
Any idea why this can be happening and how I can solve it?
UPDATE
If I open VS in safe mode this doesn't happen. SO I suspect it must be an extension, but I don't know how to discover which is the offendign extension. Is there a way to know which extension can be responsible for this (apart from uninstall/try cycles...)
I found a temporary workaround hack for this problem:
Right click on the MVC project in Visual Studio and select "Unload Project"
Right click on the project and select "Edit YourProjectName.csproj"
Replace the contents of the ProjectTypeGuids tag with the following and save the file changes:
{E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}
Open up Window Explorer and find the csproj file. Open up properties on it and mark it as Read Only.
In Visual Studio right click on the project and select Reload Project. You will be prompted to save as the csproj file. Hit Cancel when that comes up.
Go back to Windows Explorer and take off the Read Only flag.
As long has you have this project open in Visual Studio, it will think it's an MVC project, and you will have options to Add Views and Controllers. Once you switch projects or restart Visual Studio, you'll have to do this again.

CruiseControl.NET, VS 2010 and MVC 3 -- build error

Using the latest stable of CC.NET (new to it) and VS 2010.
I have defined project files for simple C# projects (4 in total) and one MVC Project.
The C# projects all compile correctly; however, the MVC3 project refuses to build.
I receive the following error in CC.NET:
error MSB4019: The imported project
"C:\Program
Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"
was not found. Confirm that the path
in the declaration is
correct, and that the file exists on
disk.
After searching around and finding This link
and This other link (both referring to older versions of Visual Studio), it seemed that the general solution was to copy these files from that directory to the solution directory, add them to the solution with visual studio, and then change this line in the .csproj file:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
To this:
<Import Project="$(SolutionDir)\Microsoft.WebApplication.targets" />
However, this technique that worked for other VS Versions produces a different result in VS 2010: I receive the .NET Project upgrade wizard, as if upgrading the project from an old version of .NET. This strangeness is compounded by the fact that even if I do an undo and re-save the file exactly as it was, I receive the same message. It's as if the project has been marked dirty or something else has changed somehow.
Anyone have any ideas? This seems like it should be easier, but I can't seem to find another resource on it anywhere. Hoping StackOverflow will come through per usual. :)
Thanks in advance for any help!
The .targets file for v10.0 also has an assembly in the install folder - Microsoft.WebApplication.Build.Tasks.dll. Did you copy that file over as well? That will likely be necessary for the .targets file to work correctly, though that may not be the cause of your problem.
It sounds like CC.Net isn't getting a proper reference to the msbuild executables.
Trying installing both of these on your build server (that's who I was able to get past that exact error).
Links :
Windows SDK .Net 4
VS2010 Integrated Shell

Resources