Visual Studio 2012 says website project's project file is edited outside of environment - visual-studio-2012

After installing Visual Studio 2012 and opening/upgrading a Visual Studio 2010 solution from Team Foundation Server that contains two "website"-type projects I keep getting the message that "The project 'website' has been modified outside the environment" with the option to reload every time I add or remove a file to the "website" project.
This is odd, because as far as I know this type of project does not have a project file and thus it is impossible to edit it, in addition, nobody is editing anything outside of the environment.
Does anyone know what causes this and how to fix it?

To at least partially answer my own question. You can solve this by closing Visual Studio 2012 and then deleting the .suo file for the solution. It should be sitting right next to the solution file and has the same name.
After deleting this file I reopened the solution and VS2012 went to get the entire solution from TFS again. When it was done, the problem was gone!

Related

Visual Studio 2015 - Class Wizard in C++

When I right click my project and go to Class Wizard I'm met with the following error:
"The solution's source code database may not have been opened. Please make sure the solution is not open in another copy of Visual Studio, and that its database file is not read only."
What I've tried so far:
Creating a new project
Restarting Visual Studio
Restarting PC
Repairing Visual Studio
Reinstalling Visual Studio
Installing MS SQL Server Compact 3.5
Deleting the folder: C:\Users\Jacob\AppData\Roaming\Microsoft\VisualStudio\14.0
None of these have had any effect, and I'm finding very few pages online where others have had this issue. I am totally at a loss on what to do next.
If anyone has any ideas, I would really appreciate them.
It turns out the problem here was actually caused by JetBrains Resharper C++, which I didn't consider could be the problem.
There seems to be no solution, however the program provides an alternative Class Wizard in the same menu.

wsdl definition not being updated even after closing iis site

I am using visual studio pro 2012 edition, one of our developers updated the wsdl definitions on a webservice without telling us and for a while i couldnt figure out why the wsdl definitions werent being updated. I did clean and build of the services, stopped the site and even exited IIS Express. Turns out if you have the solution open in visual studio with the old wsdl definition, the new definitions are not updated after pulling latest(svn). I tried several times and the only solution is to close visual studio and restart using the latest codebase.
anyone else experience this? could be a bug in vs2012 only?
I figured out what happened, my colleague copied over the hidden folder .vs folder which had the applicationhost.config file pointing to their username, vs2012 does not give any errors and happily runs the service but it serves the old pages. VS2015 shows an error page which is how i found out the problem.

VS2012/2013 fails to display solution explorer

I have this problem with both VS2012 and 2013. When I load an existing or create a new solution I get a ProviderPackage error - An exception was thrown during package instantiation and was caught in the package manager. After I close the error dialog, the solution explorer window is empty, although there are solution files open in the editor.
The ActivityLog.xml file shows different modules loading when the error occurs, depending on the project type. Is there a way that I can determine the common thread between 2012 and 2013 that is causing this error.
There is probably a corrupted dll which I have to replace. I am dead in the water until I figure this out.
Help.
Clearing the Visual Studio Component Model Cache worked for me (details: Error message "No exports were found that match the constraint contract name")
None of the previous suggestions worked for me, but this one did:
http://www.hjerpbakk.com/blog/2014/7/25/no-content-in-solution-explorer-using-visual-studio-2013
This issue is because of a MEF cache corruption. Installing [or uninstalling any extension] will invalidate the cache causing VS to rebuild it.
I ran into the empty solution explorer with Visual Studio 2013, and fixed it with a repair install.
Solution: This worked for me.
I had the same problem in Visual Studio 2015 with the Solution Explorer always showing empty, even after deleting the ComponentModelCache folder. Looking at the Microsoft.VisualStudio.Default.err file, one of the errors was:
"----- Catalog construction errors -----
Error #1
Microsoft.VisualStudio.Composition.PartDiscoveryException: Failure while scanning type ......"
Doing a Google search on Microsoft.VisualStudio.Composition.PartDiscoveryException lead me to a Nuget package for Visual Studio MEF. Since I read so many posts of people have this same problem, I figured the problem was with Visual Studio and not necessarily any particular extension. So I installed this Visual Studio MEF Nuget package, restarted Visual Studio, and now the Solution Explorer is populated every time.
Nuget: https://www.nuget.org/packages/Microsoft.VisualStudio.Composition/
Deleting the .suo file worked for me.
Close VS, delete suo file of your project (is hidden), open your project again.
I had this problem with two projects, this fixed it in both cases.
Also, creating a new project (in my case a Console Application) also worked! That was probably the easiest fix i've found thus far and you don't have to delete anything! Nice...
Go To Window menu in visual studio and click reset window layout...it will work

Error in Microsoft Visual Studio 2012 :No exports were found that match the constraint

When I opened my Project in VS2012 , I got an error
No exports were found that match the constraint:
ContractName Microsoft.VisualStudio.Utilities.IContentTypeRegistryService RequiredTypeIdentity Microsoft.VisualStudio.Utilities.IContentTypeRegistryService
Please correct before proceeding. (You might rename the current web.config and add a new one).
Why did this happen, can someone please suggest a solution?
I solved this problem by clearing the Visual Studio Component Model Cache.
Just delete or rename this folder:
%AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache
Or, for Visual Studio 2013:
%AppData%\..\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
I have fix this with update :
http://www.microsoft.com/en-in/download/confirmation.aspx?id=36020#
I'm on windows 8.1 and Visual Studio 2012.
I encountered similar issue and found this solution like magic. The steps go here:
Delete ComponentModelCache folder from below location:
C:\Users\\AppData\Local\Microsoft\VisualStudio\11.0
Make it sure to replace with your real user name on your pc.
Once deleted, recreate the folder with same name "ComponentModelCache".
In case, it gives any permissions issue, deleting the remaining files/folders one by one can work well.
The error is no more there when you try to create a project in visual studio.

Visual Studio 2012 doesn't convert vs2010 solution?

I opened my vs2010 solution with vs2012 but it didn't make any conversion as from 2008 to 2010 was happening. So my solution still remains the same as 10 label on it. when I make a new solution of course it has 11 label on it. I haven't got any problem running like that but I am curious. Is there any difference? if yes, how to convert into vs2012 solution?
I managed to 'convert' the solution file to change the line containing '# Visual Studio 2010' to '# Visual Studio 2012' in the .SLN file.
Manual editing of the solution file is not necessary, or recommended. Simply open the VS2010 solution in VS2012, left-click the solution (at the very top of the Solution Explorer), then use File | Save As to overwrite the original file. This will effectively convert the VS2010 solution file to a VS2012 solution file.
There are some exceptions, but mostly you'll be able to open the same project and solution files files in both VS2012 and VS2010 SP1.
VS2012 may convert projects when you first open them, but the changes are (except noted in the document linked) backward compatible with VS2010 (ie using conditionals where needed to only apply to either version when loaded) Most project types will be left entirely untouched though.
It is about Visual Studio 2012 Compatibility
If you created your assets in Visual Studio 2010 with Service Pack 1 (SP1), many of them will load and run in Visual Studio 2012 without any further action on your part.
Many assets will also open again in Visual Studio 2010 with SP1 without any issues, even after you open those assets in Visual Studio 2012
For C++ projects it makes a difference, as the 2012 compiler (VC11) will only be used on projects that are explicitly 2012, not on 2010 projects opened in VS 2012. Some C++11 improvements are available with the VC11 compiler but not with VC10 (see this SO Answer for a summary), including:
Range based for-loops
New standard library headers (atomic, mutex, thread,...)
Smaller standard library container sizes
(And more to follow when the Nov 2012 CTP is delivered to VS 2012)
In order to convert from VS 2010 project to VS2012 there is no need to manually edit the solution file or 'Save As' over the existing project. Instead:
If you decline the update when first prompted, you can update the project later by opening the Project menu and choosing Update VC++ projects... [at the top of the menu options]
From MSDN's "How to: Upgrade Visual C++ Projects to Visual Studio 2012"
(This page was linked from #Joachim's MSDN link, but I wanted to have the answer here on SO since a number of other answers suggested manual workarounds instead of this VS 2012 feature)
In my case, I had some Visual Source Safe stuff (my project was created with Visual Studio 2003/2005, yes, very old!)
Once I manually removed the VSS stuff, the conversion succeeded.
PS: I know it's about VS2010, but maybe this helps others.
You can convert a project from VS2010 to VS2012 by doing the following:
Add the 2010 project to your VS2012 solution by right-click on your solution in the Solution Explorer and Select Add --> Existing Project...
The project will appear in the solution and will have (Visual Studio 2010) appended to its name.
Right-click on the added project and select Properties.
In the Configuration Properties --> General pane, change the setting in Platform Toolset field to Visual Studio 2012 (v110)
Repeat for each configuration type, e.g. Release and Debug.
I came across this question while googling for a solution to a specific problem: MSBuild was failing to execute the Publish target against a VS2012 solution that had started life in VS2010 when called from the command line (specifically through TeamCity):
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.3\Microsoft.WindowsAzure.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
MSBuild was looking for the Azure SDK 2.3 targets in the VS10 location (C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\2.3\Microsoft.WindowsAzure.targets). The cause is explained by Sayed Ibrahim Hashimi in a blog post and, as I understood it, boils down to some decisions they made while enabling cross-version compatibility for solution files. The solution was simple: add the VisualStudioVersion property to the MSBuild invocation, something like this:
msbuild.exe MyAwesomeWeb.sln /p:VisualStudioVersion=11.0
Practically speaking, this overrides the following in each csproj file:
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
Presumably you could get the same result by editing all of these by hand to replace 10.0 with 11.0 but that might break backwards-compatibility -- I haven't tried it. I also haven't tried an update to VS2013 to see if the problem persists.
So to wrap this up by answering the question: yes, there are some differences before you "convert" (using any of the methods offered by other answerers) and some differences remain afterwards.
This is slightly different, but along the same lines so in case it helps anyone:
I was loading a project where it looked like it was loading and then kept showing all projects as unavailable. No errors were on the migration report. I tried reloading the solution and projects many times, using various methods including suggestions here.
Finally I found a "Resolve Errors" option when right clicking on the solution in the Solution Explorer. VS went through a load process again and it worked; no problems.
I don't know what it did differently that time, but apparently it made a difference.
it's to simple just edit the .sol file
change the version to 11
like this
Microsoft Visual Studio Solution File, Format Version 12.00
Visual Studio 2012

Resources