TFS solution thinks it is still under version control - visual-studio

I have unbound all projects from TFS version control, but every time I open the solution it pops-up a dialog asking me if I want to connect to TFS.
Q: How do I get rid of it?

Found it!
I had to go into the SOLUTION FILE and remove the following (by-hand)
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 8
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = https://yournamehere.visualstudio.com/
SccLocalPath0 = .
SccProjectUniqueName1 = Data\\Data.csproj
SccProjectTopLevelParentUniqueName1 = Guardians.sln
SccProjectName1 = Data
SccLocalPath1 = Data
SccProjectUniqueName2 = Framework\\Framework.csproj
SccProjectTopLevelParentUniqueName2 = Guardians.sln
SccProjectName2 = Framework
SccLocalPath2 = Framework
SccProjectUniqueName3 = Models\\Models.csproj
SccProjectTopLevelParentUniqueName3 = Guardians.sln
SccProjectName3 = Models
SccLocalPath3 = Models
SccProjectUniqueName4 = Dictionary\\Dictionary.csproj
SccProjectTopLevelParentUniqueName4 = Guardians.sln
SccProjectName4 = Dictionary
SccLocalPath4 = Dictionary
SccProjectUniqueName5 = Web\\Web.csproj
SccProjectTopLevelParentUniqueName5 = Guardians.sln
SccProjectName5 = Web
SccLocalPath5 = Web
SccProjectUniqueName6 = Cloud\\Cloud.ccproj
SccProjectTopLevelParentUniqueName6 = Guardians.sln
SccProjectName6 = Cloud
SccLocalPath6 = Cloud
SccProjectUniqueName7 = UnitTests\\UnitTests.csproj
SccProjectTopLevelParentUniqueName7 = Guardians.sln
SccProjectName7 = UnitTests
SccLocalPath7 = UnitTests
EndGlobalSection

In the solution's and projects' folders you will find *.vspscc files which are responsible of version control, remove them all and your problem should be fixed.
There is also a .vs and $tf hidden folders, you need to remove those also.

Related

Why do source control entries keep getting added back to my .sln file?

I was able to finally get a legacy ASP.NET project to run which I have been tasked to maintain. A question about it and my tentative auto-answer is here.
In a nutshell, it seems one of the things I needed to do to get it to run was to clean out the TFS files and sections referring to them in the .sln file.
As to the latter, I remove these entries from the solution (.sln) file:
SccProjectName = "SAK"
SccAuxPath = "SAK"
SccLocalPath = "SAK"
SccProvider = "SAK"
...but they have been added back for some reason, so that my .sln contains them again, and for context/full disclosure is:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "MembersOrderEntry", "MembersOrderEntry", "{7D7D3972-0891-4600-BCBC-
CA40B0D0FF6E}"
ProjectSection(WebsiteProperties) = preProject
SccProjectName = "SAK"
SccAuxPath = "SAK"
SccLocalPath = "SAK"
SccProvider = "SAK"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv3.5"
Debug.AspNetCompiler.VirtualPath = "/MembersOrderEntry"
Debug.AspNetCompiler.PhysicalPath = "MembersOrderEntry\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\MembersOrderEntry\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/MembersOrderEntry"
Release.AspNetCompiler.PhysicalPath = "MembersOrderEntry\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\MembersOrderEntry\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "2030"
VWDDynamicPort = "false"
SlnRelativePath = "MembersOrderEntry\"
DefaultWebSiteLanguage = "Visual Basic"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D7D3972-0891-4600-BCBC-CA40B0D0FF6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D7D3972-0891-4600-BCBC-CA40B0D0FF6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D7D3972-0891-4600-BCBC-CA40B0D0FF6E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Why are the "SAK" entries added back, and how can I prevent that from occurring again? This project is not under source control.
When I open the solution, I see a message that says, "...mappings could not be found ... temporarily disconnected..." Why is it even expecting to find mappings?
The folder that the project exists in is mapped to TFS as a Workspace. You will need to move the files or remove the workspace or Visual Studio will keep adding Source Control back.

Set Coordinates Reference Systems to a list of SpatialPolygon

I want to set the Coordinates Reference Systems to a list of SpatialPolygon called SpP
library(sp)
Sr1 = Polygon(cbind(c(2,4,4,1,2),c(2,3,5,4,2)))
Sr2 = Polygon(cbind(c(5,4,2,5),c(2,3,2,2)))
Sr3 = Polygon(cbind(c(4,4,5,10,4),c(5,3,2,5,5)))
Sr4 = Polygon(cbind(c(5,6,6,5,5),c(4,4,3,3,4)), hole = TRUE)
Srs1 = Polygons(list(Sr1), "s1")
Srs2 = Polygons(list(Sr2), "s2")
Srs3 = Polygons(list(Sr3, Sr4), "s3/4")
SpP = SpatialPolygons(list(Srs1,Srs2,Srs3), 1:3)
I want to give a coordinate reference system to each features in the list. CRS("+proj=longlat +datum=WGS84"
For any Spatial* object, you can set the CRS with the proj4string function.
For your example:
proj4string(SpP) <- CRS("+proj=longlat +datum=WGS84")
See ?proj4string and ?CRS for more details.

AS3 SharedObject - Background images fails to load correctly. Set of images stored inside MC fails to load correct image from save

having issues with making a set of background images save and load correctly. Please note, that this has worked correctly in the past with "1 - 2" images in the caseSwapper.
Structure :
On my stage I have set of draggable objects that you can save and load as you please. (these work)
The background, which is movieClip called "caseSwapper" contains a set of frames with different images inside each frame. E.G frame one is called (labelled) "frameone" - contains a pretty picture. Frame 2 is labelled "Frametwo" which contains an alternative image etc etc
A load and save button on the stage allows you to store the data to sharedObject "mySO"
Issues and Behaviour
On the face of it, the save appears to be working. The trace statement is declaring that the current frame is being stored to mySO... although I'm not entirely convinced it is. Basically, when the player has a certain background selected and they click 'save' I need the current image to be saved/written to the sharedObject.
Notes : Frame 1 appears to work when I click 'load' from the stage. When I 'launch' the application (not load) even after saving frame 123 or 4 only frame 4 launches/dis[lays. I then have to click load to retrieve my sharedObject... which only shows the first frame... Any pointers. Script to edit is at the bottom. Please Note, that I'm designer first and foremost!
save_btn.addEventListener (MouseEvent.CLICK, clickersave);
function clickersave (e:MouseEvent):void {
saved.play();
mySO.data.myblcskull_mc_x = blcskull_mc.x;
mySO.data.myblcskull_mc_y = blcskull_mc.y;
mySO.data.myblackhandbag_mc_y = blackhandbag_mc.y;
mySO.data.myblackhandbag_mc_x = blackhandbag_mc.x;
mySO.data.myhotlips_mc_x = hotlips_mc.x;
mySO.data.myhotlips_mc_y = hotlips_mc.y;
mySO.data.my_x = bones_mc.x;
mySO.data.my_y = bones_mc.y;
mySO.data.mybut_x = btrfly_mc.x;
mySO.data.mybut_y = btrfly_mc.y;
mySO.data.mytig_x = tiger_mc.x;
mySO.data.mytig_y = tiger_mc.y;
mySO.data.myskullface_mc_y = skullface_mc.y;
mySO.data.myskullface_mc_x = skullface_mc.x;
mySO.data.myblack_tile_mc_zero_y = black_tile_mc_zero.y;
mySO.data.myblack_tile_mc_zero_x = black_tile_mc_zero.x;
mySO.data.myblack_tile_mc_one_x = black_tile_mc_one.x;
mySO.data.myblack_tile_mc_one_y = black_tile_mc_one.y;
mySO.data.mycrown_mc_y = crown_mc.y;
mySO.data.mycrown_mc_x = crown_mc.x;
mySO.data.myperfume_mc_y = perfume_mc.y;
mySO.data.myperfume_mc_x = perfume_mc.x;
mySO.data.myheart_mc_x = heart_mc.x;
mySO.data.myheart_mc_y = heart_mc.y;
mySO.data.myrose_mc_y = rose_mc.y;
mySO.data.myrose_mc_x = rose_mc.x;
// tears saved - - - - - - -
mySO.data.mytear_drop_mc_one_x = tear_drop_mc_one.x;
mySO.data.mytear_drop_mc_one_y = tear_drop_mc_one.y;
mySO.data.mytearup_drop_mc_three_x = tearup_drop_mc_three.x;
mySO.data.mytearup_drop_mc_three_y = tearup_drop_mc_three.y;
mySO.data.mytearup_drop_mc_four_x = tearup_drop_mc_four.x;
mySO.data.mytearup_drop_mc_four_y = tearup_drop_mc_four.y;
mySO.data.mytear_drop_mc_two_x = tear_drop_mc.x;
mySO.data.mytear_drop_mc_two_y = tear_drop_mc.y;
mySO.data.mytear_side_mc_one_x = tear_side_mc_one.x;
mySO.data.mytear_side_mc_one_y = tear_side_mc_one.y;
mySO.data.mytear_side_mc_two_x = tear_side_mc_two.x;
mySO.data.mytear_side_mc_two_y = tear_side_mc_two.y;
mySO.data.mytear_op_mc_one_y = tear_op_mc_one.y;
mySO.data.mytear_op_mc_one_x = tear_op_mc_one.x;
mySO.data.mytear_op_mc_two_y = tear_op_mc_two.y;
mySO.data.mytear_op_mc_two_x = tear_op_mc_two.x;
//tear_op_mc_one
// pink gems
mySO.data.mypink_jewel_mc_one_x = pink_jewel_mc_one.x;
mySO.data.mypink_jewel_mc_one_y = pink_jewel_mc_one.y;
mySO.data.mypink_jewel_mc_two_x = pink_jewel_mc_two.x;
mySO.data.mypink_jewel_mc_two_y = pink_jewel_mc_two.y;
mySO.data.mypink_jewel_mc_three_x = pink_jewel_mc_three.x;
mySO.data.mypink_jewel_mc_three_y = pink_jewel_mc_three.y;
mySO.data.mypink_jewel_mc_four_x = pink_jewel_mc_four.x;
mySO.data.mypink_jewel_mc_four_y = pink_jewel_mc_four.y;
mySO.data.mypink_jewel_mc_five_x = pink_jewel_mc_five.x;
mySO.data.mypink_jewel_mc_five_y = pink_jewel_mc_five.y;
mySO.data.mypink_jewel_mc_six_x = pink_jewel_mc_six.x;
mySO.data.mypink_jewel_mc_six_y = pink_jewel_mc_six.y;
mySO.data.mypink_jewel_mc_seven_x = pink_jewel_mc_seven.x;
mySO.data.mypink_jewel_mc_seven_y = pink_jewel_mc_seven.y;
mySO.data.mypink_jewel_mc_eight_x = pink_jewel_mc_eight.x;
mySO.data.mypink_jewel_mc_eight_y = pink_jewel_mc_eight.y;
mySO.data.mypink_jewel_mc_nine_x = pink_jewel_mc_nine.x;
mySO.data.mypink_jewel_mc_nine_y = pink_jewel_mc_nine.y;
// bg saves
mySO.data.myBgFrame = 1;
mySO.data.myBgFrameone = 2;
mySO.data.myBgFrametwo = 3;
mySO.data.myBgFramethree = 4;
trace("bgbackgrounds");
// silver gems - - - - - - - - -
mySO.data.mycircle_gem_mc_x = circle_gem_mc.x;
mySO.data.mycircle_gem_mc_y = circle_gem_mc.y;
mySO.data.mycircle_gem_mc_two_x = circle_gem_mc_two.x;
mySO.data.mycircle_gem_mc_two_y = circle_gem_mc_two.y;
mySO.data.mycircle_gem_mc_thirteen_x = circle_gem_mc_thirteen.x;
mySO.data.mycircle_gem_mc_thirteen_y = circle_gem_mc_thirteen.y;
//circle_gem_mc_six
mySO.flush ();
}
if (mySO.data.myBgFrame){
caseSwapper.gotoAndStop(mySO.data.myBgFrame);
}
if (mySO.data.myBgFrameone){
caseSwapper.gotoAndStop(mySO.data.myBgFrameone);
}
if (mySO.data.myBgFrametwo){
caseSwapper.gotoAndStop(mySO.data.myBgFrametwo);
}
if (mySO.data.myBgFramethree){
caseSwapper.gotoAndStop(mySO.data.myBgFramethree);
}
//caseSwapper.currentFrame = mySO.data.myBgFrame;
/////// ---------------------- loader
// ---------------------- LOADER -------------------------
//--------------------------------------------------------
//--------------------------------------------------------
// when load button is clicked it loads the x and y position of dragged objects pulled from the
//sharedOject, it remembers the last var!
load_btn.addEventListener (MouseEvent.CLICK, loadlast);
function loadlast (e:MouseEvent):void {
//saved.play();
caseSwapper.gotoAndStop(mySO.data.myBgFrame);
//caseSwapper.currentFrame = mySO.data.myBgFrame;
//caseSwapper.gotoAndStop(mySO.data.myBgFrameone);
//caseSwapper.gotoAndStop(mySO.data.myBgFrametwo);
//caseSwapper.gotoAndStop(mySO.data.myBgFramethree);
//caseSwapper.gotoAndStop(mySO.data.myBgFramefour);
blcskull_mc.x = mySO.data.myblcskull_mc_x;
blcskull_mc.y = mySO.data.myblcskull_mc_y;
blackhandbag_mc.y = mySO.data.myblackhandbag_mc_y;
blackhandbag_mc.x = mySO.data.myblackhandbag_mc_x;
bones_mc.x = mySO.data.my_x;
bones_mc.y = mySO.data.my_y;
tiger_mc.x = mySO.data.mytig_x;
tiger_mc.y = mySO.data.mytig_y;
btrfly_mc.x = mySO.data.mybut_x;
btrfly_mc.y = mySO.data.mybut_y;
crown_mc.x = mySO.data.mycrown_mc_x;
crown_mc.y = mySO.data.mycrown_mc_y;
perfume_mc.x = mySO.data.myperfume_mc_x;
perfume_mc.y = mySO.data.myperfume_mc_y;
heart_mc.x = mySO.data.myheart_mc_x;
heart_mc.y = mySO.data.myheart_mc_y;
rose_mc.y = mySO.data.myrose_mc_y;
rose_mc.x = mySO.data.myrose_mc_x;
pink_jewel_mc_one.x = mySO.data.mypink_jewel_mc_one_x;
pink_jewel_mc_one.y = mySO.data.mypink_jewel_mc_one_y;
pink_jewel_mc_two.x = mySO.data.mypink_jewel_mc_two_x;
pink_jewel_mc_two.y = mySO.data.mypink_jewel_mc_two_y;
pink_jewel_mc_three.x = mySO.data.mypink_jewel_mc_three_x;
pink_jewel_mc_three.y = mySO.data.mypink_jewel_mc_three_y;
pink_jewel_mc_four.x = mySO.data.mypink_jewel_mc_four_x;
pink_jewel_mc_four.y = mySO.data.mypink_jewel_mc_four_y;
pink_jewel_mc_five.x = mySO.data.mypink_jewel_mc_five_x;
pink_jewel_mc_five.y = mySO.data.mypink_jewel_mc_five_y;
pink_jewel_mc_six.x = mySO.data.mypink_jewel_mc_six_x;
pink_jewel_mc_six.y = mySO.data.mypink_jewel_mc_six_y;
pink_jewel_mc_seven.x = mySO.data.mypink_jewel_mc_seven_x;
pink_jewel_mc_seven.y = mySO.data.mypink_jewel_mc_seven_y;
pink_jewel_mc_eight.x = mySO.data.mypink_jewel_mc_eight_x;
pink_jewel_mc_eight.y = mySO.data.mypink_jewel_mc_eight_y;
pink_jewel_mc_nine.x = mySO.data.mypink_jewel_mc_nine_x;
pink_jewel_mc_nine.y = mySO.data.mypink_jewel_mc_nine_y;
hotlips_mc.x = mySO.data.myhotlips_mc_x;
hotlips_mc.y = mySO.data.myhotlips_mc_y;
tearup_drop_mc_three.y = mySO.data.mytearup_drop_mc_three_y;
tearup_drop_mc_three.x = mySO.data.mytearup_drop_mc_three_x;
tearup_drop_mc_four.x = mySO.data.mytearup_drop_mc_four_x;
tearup_drop_mc_four.y = mySO.data.mytearup_drop_mc_four_y;
tear_side_mc_one.x = mySO.data.mytear_side_mc_one_x;
tear_side_mc_one.y = mySO.data.mytear_side_mc_one_y;
//tear_side_mc_two.x = mySO.data.mytear_side_mc_two_x;
//tear_side_mc_two.y = mySO.data.mytear_side_mc_two_y;
tear_op_mc_one.y = mySO.data.mytear_op_mc_one_y;
tear_op_mc_one.x = mySO.data.mytear_op_mc_one_x;
tear_op_mc_two.y = mySO.data.mytear_op_mc_two_y;
tear_op_mc_two.x = mySO.data.mytear_op_mc_two_x;
//--- silver little gems -----------------
circle_gem_mc_thirteen.x = mySO.data.mycircle_gem_mc_thirteen_x;
circle_gem_mc_thirteen.y = mySO.data.mycircle_gem_mc_thirteen_y;
circle_gem_mc_two.x = mySO.data.mycircle_circle_gem_mc_two_x;
circle_gem_mc_two.y = mySO.data.mycircle_circle_gem_mc_two_y;
mySO.flush ();
}
You're not actually storing the current frame anywhere — this section just saves the same numbers every time:
mySO.data.myBgFrame = 1;
mySO.data.myBgFrameone = 2;
mySO.data.myBgFrametwo = 3;
mySO.data.myBgFramethree = 4;
This is also why you're only seeing frame four when you launch, because all of your if statements see a positive number (and anything other than zero or NaN counts as true), so they all get executed one after the other.
Instead of the above, all you need is this in your save function:
mySO.data.myBgFrame = caseSwapper.currentFrame;
Then if you want to jump to that frame on launch, you only need your first if statement:
if (mySO.data.myBgFrame){
caseSwapper.gotoAndStop(mySO.data.myBgFrame);
}

Setting solution configurations in visual studio custom wizard

I have created a custom wizard for visual studio 2010. I can setup the the project configurations but I need I can't find how to set the solution configurations.
Below is an abstract from my code to setup a project configuration from default.js. How can I do a similar thin for the solution?
var debugConfig = proj.Object.Configurations('Debug');
debugConfig.OutputDirectory = '$(ProjectDir)$(ConfigurationName)';
debugConfig.IntermediateDirectory = '$(ConfigurationName)';
debugConfig.ConfigurationType = typeStaticLibrary;
debugConfig.CharacterSet = charSetUnicode;
var CLTool = debugConfig.Tools('VCCLCompilerTool');
CLTool.Optimization = optimizeDisabled;
CLTool.AdditionalIncludeDirectories = '.;$(COREDIR)/cliprt';
CLTool.PreprocessorDefinitions = 'WIN32;_DEBUG;_LIB;CLP_PLATFORM_WIN32';
CLTool.MinimalRebuild = 'true';
CLTool.BasicRuntimeChecks = runtimeBasicCheckAll;
CLTool.RuntimeLibrary = rtMultiThreadedDebug;
CLTool.UsePrecompiledHeader = pchNone;
CLTool.WarningLevel = warningLevel_3;
Update
I recently migrated from Visual Studio 2008 to Visual studio 2010. When I checked back at the 2008 version I noticed that it was behaving as required ie the new configurations were added for both the solution and the project. Is there a known difference in this respect between studio 2008 and 2010?
Ok
I have a solution now. I modified the above code to look like this.
var solCurrentConfig = Solution.SolutionBuild.SolutionConfigurations.Add('AutonomousDebug', 'Debug', true);
var currentConfig = proj.Object.Configurations('AutonomousDebug');
debugConfig.CopyTo( currentConfig );
currentConfig = proj.Object.Configurations('AutonomousDebug');
currentConfig.OutputDirectory = '$(SolutionDir)$(Configuration)';
currentConfig.IntermediateDirectory = '$(Configuration)/';

Error when opening visual studio 2010 solution file

I have a solution file that only contains one web application project. Everytime I open that file, this message always pops up:
Then in the output window it says:
Some of the properties associated with the solution could not be read.
And here is the solution file's text:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Web Application", "..\Web
Application", "{2D32A179-D771-4510-9C8B-D17D50BE3AAE}"
ProjectSection(WebsiteProperties) = preProject
SccProjectName = "SAK"
SccAuxPath = "SAK"
SccLocalPath = "SAK"
SccProvider = "SAK"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv3.5"
Debug.AspNetCompiler.VirtualPath = "/Web Application"
Debug.AspNetCompiler.PhysicalPath = "D:\Projects\Web Application\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\Web Application\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/Web Application"
Release.AspNetCompiler.PhysicalPath = "D:\Projects\Web Application\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\Web Application\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "51664"
EndProjectSection
EndProject
Global
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 1
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = server_teamprojectcollection
SccWebProject0 = true
SccProjectUniqueName0 = .
SccProjectName0 = .
SccAuxPath0 = server_teamprojectcollection
SccLocalPath0 = .
SccProvider0 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccProjectEnlistmentChoice0 = 2
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2D32A179-D771-4510-9C8B-D17D50BE3AAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D32A179-D771-4510-9C8B-D17D50BE3AAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
`
Run Visual Studio as Administrator and then try opening the project. This happens for 2 reasons.
You are trying to open a project that you downloaded from online and the project file is marked as that.
You are trying to open a project that is a web application project and the project is set to use the local IIS.
It might well be that both apply to you.
If you downloaded a .zip file from the Interwebs, then before you unzip it, go into the file's properties and Unlock it, then unarchive it. This way Windows will not mark all files it contains as unsafe.
Update:
After reading your question in a bit more detail, I have done some research and I think the issue lies in the TFS settings contained in your solution file. They have somehow gone awry or gotten corrupted.
Try following the procedure described here to solve the issue. If that still doesn't work, then create a blank solution file and add the web application to the solution using existing source. You will find this under the File menu under the New menu item.

Resources