Determine Visual Studio Update Version in NuGet - visual-studio-2012

Is it possible to determine in init.ps1, whether Update 2 (or later) of Visual Studio 2012 Premium is installed? I found $dte.Version and $dte.Edition, but more detailed information seems to be missing ...

dte.Version should be the Information you need. The following post shows the version numbers for Update 1 (11.0.51106.01) and Update 4 (11.0.61030.00) (I can confirm this value)
Visual Studio 2012 Update 4 installs but still says Update 1
Edit:
OK, seems to be a bit harder:
You can retrieve the path to devenv.exe with $dte.FullName and then retrieve the file-version.
My powershell knowledge is very limited, so here is the c# code:
FileVersionInfo.GetVersionInfo(#"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe")
The resulting FileVersionInfo has the property ProductVersion which contains the information you need.

Related

VS2012 missing compiler errors in error list after upgrade from vs2010

Just upgraded to Visual Studio 2012, connected to my TFS solution, upgraded all the projects from v4.0 to v4.5. Solution compiles and runs fine. Super.
Now I'm adding new code but compiler errors are not listed in the Error List output window. I only see errors related to .dll files not being found.
e.g. Error 1 Could not copy the file "C:\SourceCode\<snip>Library.dll" because it was not found. C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets
Well of course it can't be found, I put the line:
thing bob = new thing();
into a class.
Unfortunately this error is not reported during compilation.
Even the detailed comiler output shows nothing after the csc.exe task:
6>Task "Csc"
6> C:\Windows\Microsoft.NET\Framework\v4.0.30319\Csc.exe <snip>
6>Done executing task "Csc".
If I run the csc.exe task in a cmd window you can clearly see the exception:
Microsoft (R) Visual C# Compiler version 4.0.30319.17929
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.
State\ConditionalAction.cs(16,13,16,18): error CS0246: The type or namespace name 'thing' could not be found (are you missing a using directive or an assembly reference?)
State\ConditionalAction.cs(16,29,16,34): error CS0246: The type or namespace name 'thing' could not be found (are you missing a using directive or an assembly reference?)
Has anyone seen this problem before or have any ideas?
EDIT more evidence
It seems that 'hard' compile errors are being reported i.e. by removing the semi-colon from the line of rubbish gives me a compiler error:
thing bob = new thing()
Error 2 ; expected C:\\ConditionalAction.cs 16
The error to do with the missing type, however, is still not present.
EDIT 2 more evidence
It appears that VS 2012 is unable to correctly identify that the project has an error with the missing type when starting to run and debug the MVC app (F5).
I just removed the offending code, ran the app, re-inserted the offending code, re-ran the app and VS merrily ran the previously-compiled version of the application without complaint.
I have had problems with visual studio, when upgrading to visual studio professional 2012.
Firstly, checking fundamentals.
Are you using the computer as a user with Administrative rights?
I suspect you are, but if not, you need to have administrative rights.
Have you checked if any files are being blocked by your firewall?
When I switched to the full version of Avast I find I have to disable the File System Shield It loves to remove my executable files when I try to run my visual studio projects.
Ensure you are creating your projects in 4.5 Framework.
What I did, was I ended up uninstalling EVERYTHING that was associated with both Visual Studio downloads. If you are able to remove and save your project files elsewhere and then bring them back. Go through all your program files to see if there is anything hidden in the wrong folder and check your C drive.
Which meant downloading and reinstalling (fresh):
Install Windows 7 Service Pack 1
Visual C++ 2012 Redistributable Package (arm.exe, x64.exe and x86,exe)
Microsoft .NET Framework 4.5
Microsoft Visual Studio 2012 SDK
Please read this quote from MSDN about Visual Studio 2012 update 3
Note Visual Studio and Team Foundation Server (TFS) installation
mechanics are different. The Visual Studio update installs on top of
whatever is already installed on the computer. The TFS update is a
full layout that replaces whatever is installed on the computer.
Before you try to apply the TFS update, make sure that you have a full
backup of your current databases. If the TFS update installation
fails, you will be unable to restart the update or roll back to the
earlier version of TFS without performing a restore procedure.
Go to this page for more information about the Visual Studio 2012 Update 3.
Here is also useful link Configuring Programs for 64-Bit (Visual C++).

Visual Studio 2012 updates

How can I find What Update version I have in Visual Studio 2012? (update 1 or 2 or 3). HOw can I go back to update 1 so that I can build .dll which can be supported in windows XP? I am sorry It's not a programming question but highly appreciated for your answer. I'm stuck!
I have a following Error: Unable to load DLL 'xxx.dll': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
My Target OS is windows XP: 32 bit .NET 4.0.
Also Same dll works for windows 7 and other so I think there shouldn't be dependency problem.
Help -> About will tell you what update you are running.
As far as I can tell, targeting windows XP is supported from VS 2012 with any update. You just need to make sure the project targets a version of the .NET framework that is supported on Windows XP. (.NET 4 or earlier)
How can I find What Update version I have in Visual Studio 2012?
Open Visual Studio, Click Help, Click About. See Second line.
Mine says "Version 11.0.60315.01 Update 2"
How can I go back to update 1?
(assuming Windows 7)
Control panel > Programs and Features > view installed updates > uninstall the update you want under the Visual Studio 2012 category.
That being said, I have no idea if this solution is actually something you need to do or will fix your problem. It is simply about how to remove the updates. It sounds like you may just need to download the latest .NET framework for XP.

The 'ProviderPackage' package did not load correctly

I installed Visual Studio 2012 and at a later date Update 2. After installing Update 2, when I load any project, I get the following error:
---------------------------
Microsoft Visual Studio
---------------------------
The 'ProviderPackage' package did not load correctly.
The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\username\AppData\Roaming\Microsoft\VisualStudio\11.0\ActivityLog.xml'.
Continue to show this error message?
---------------------------
Yes No
---------------------------
After locating the ActivityLog.xml, I see the following set of errors:
<entry>
<record>300</record>
<time>2013/04/23 18:32:54.002</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Begin package load [ProviderPackage]</description>
<guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
</entry>
<entry>
<record>301</record>
<time>2013/04/23 18:32:54.012</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [ProviderPackage]</description>
<guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
<hr>80131522</hr>
<errorinfo>Method 'GetHostedIntellisenseTypes' in type 'Microsoft.VisualStudio.Progression.DTEWrapperCached' from assembly 'Microsoft.VisualStudio.GraphProviderPackage, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' does not have an implementation.</errorinfo>
</entry>
<entry>
<record>302</record>
<time>2013/04/23 18:32:54.012</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [ProviderPackage]</description>
<guid>{5F2E5E42-4192-4D79-A0D8-1D881E808829}</guid>
<hr>80131522</hr>
<errorinfo>Method 'GetHostedIntellisenseTypes' in type 'Microsoft.VisualStudio.Progression.DTEWrapperCached' from assembly 'Microsoft.VisualStudio.GraphProviderPackage, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' does not have an implementation.</errorinfo>
Google searches do not reveal an exact match on my issue. I've tried searching the packages on the install ISO and cannot locate a package that needs to be repaired...
F:\packages>dir /s *provider*
Volume in drive F is VS2012_ULT_MSDN_ENU
Volume Serial Number is 4A21-C8BD
Directory of F:\packages\SSDT
07/26/2012 11:30 AM 780,288 DbSqlPackageProvider.msi
1 File(s) 780,288 bytes
Total Files Listed:
1 File(s) 780,288 bytes
0 Dir(s) 0 bytes free
Any other ideas?
Close Visual Studio.
Open a Developer Command Prompt for Visual Studio 2012 (as administrator).
Type devenv /setup.
Restart Visual Studio.
Possible duplicate of Visual Studio 2012 error: Package 'Visual C++ package' failed to load
See Visual C++ package: failed to load?????
This is Aaron's (Aaron Reed) answer from above, just copied as an answer instead of part of the question:
Fixed it... Fixed it... Fixed it...
Opened Programs and Features (run: appwiz.cpl)
Sorted list of installed apps by: Install Date
Filtered list by adding "SQL" to the upper right search filter
List item
I installed VS2012 on 4/1/13, so I went through each listed SQL item in the list, and right click --> Repair
From there I ran VS2012 and opened the target Solution file without issue.
My list:
Microsoft SQL Server 2012 Data-Tier App Framework
Microsoft SQL Server Data Tools - enu (11.1.20627.00)
Microsoft SQL Server 2012 Management Objects (x64)
Microsoft System CLR Types for SQL Server 2012 (x64)
Microsoft System CLR Types for SQL Server 2012
Microsoft SQL Server 2012 Management Objects
Microsoft SQL Server 2012 Transact-SQL Compiler Service
Microsoft SQL Server 2012 Command Line Utilities
Microsoft SQL Server Data Tools Build Utilities - enu (11.1.206...
Microsoft SQL Server Compact 4.0 SP1 x64 ENU
Microsoft SQL Server 2012 T-SQL Language Service
Microsoft SQL Server 2012 Native Client
Microsoft SQL Server 2012 Data-Tier App Framework
Microsoft SQL Server 2012 Express LocalDB
Microsoft SQL Server 2012 Transact-SQL SpriptDom
This worked for me -
In order to fix the issue one needs to clear the Visual Studio cache under:
%LOCALAPPDATA%\Microsoft\VisualStudio\11.0\ComponentModelCache
Thanks go to blog post SetSite failed for package [Microsoft.VisualStudio.Editor.Implementation.EditorPackage].
Usually this can be fixed by clearing the Visual Studio cache under:
Visual Studio 2012: %LOCALAPPDATA%\Microsoft\VisualStudio\11.0\ComponentModelCache
Visual Studio 2013: %LOCALAPPDATA%\Microsoft\VisualStudio\12.0\ComponentModelCache
I fixed this by uninstalling or removing:
Microsoft SQL Server Data Tools - enu (14.0.50325.0)
I hope this helps :)
Worked for me.
Window7 SP1 + VS 2013
Open a Developer Command Propmpt for VS 2012 (as administrator).
Run devenv /setup.
An even quicker fix is to simply repair the Microsoft SQL Server in the list. That fixed my problem.
Uninstalling/Repairing SQL Server Data tools is the only thing which worked for me, thanks to wayne.blackmon comment.
Picture below
For me the ActivityLog.xml stated
<errorinfo>Access to the path 'C:\Users\Klas\Documents\Visual Studio
2015\ArchitectureExplorer' is denied.</errorinfo>
When I examined this folder I realized that the entire folder structure here
C:\Users\Klas\Documents\Visual Studio 2015
had permission set so that my user had no write permissions. I added Full Control rights to my user for this folder and everything below.
After that, the message went away. Also, when I started Visual Studio it created lots of subfolders to this folder.
I had the same issue in Visual Studio 2013 for Windows 8.1.
The previous answers didn't work for me. I had to repair Visual Studio and then reboot my machine.
I was getting this error on Visual Studio start up:
the 'visual studio component model host package' did not load correctly...
After that bunch of other The '' package did not load correctly... error messages.
I realized I don't have enough free space on my C drive, where the Visual Studio were installed.
I opened up some space and restarted the Visual Studio, solved the problem.
Not sure if it has anything to do with the free space on disk though.
In my case the problem appeared after I installed Visual Studio 2015. From that point nor 2015, nor previous versions of Visual Studio would load.
The problem was the PATH environment variable exceeding the MAX length.
I shortened it to less than 2048 and restarted the machine. Visual Studio started loading, but with some errors still. Lastly run the devenv /setup, and all is back to normal.
I just had a similar error (on Windows 7. I installed Visual Studio 2015 Professional and then after that, several "...package did not load correctly" messages started showing up when I ran Visual Studio 2012).
What fixed my issue was to repair "Microsoft Studio Tools for Applications 2012".
Run "appwiz.cpl" (Control Panel → Programs → Uninstall a program
Right-click on "Microsoft Studio Tools for Applications 2012. Select "Change", then click "Repair".
After this, I can open up Visual Studio 2012 without those error messages.
I had a similar error. After I updated to VS2012.U2, the problem went away. TFS 2012 update 2 can't be removed without removing TFS. While I had an issue with upgrading from TFS2012.U1 to U2, I have found TFS2012.U2 to be worthwhile.
It was the problem with access rights to my %USERPROFILE% directory (because of the failure with the PC). Setting permissions to full access fixed it.
Another suggestion,
Run as admin, and restart the VS application.
Apply package update.
Reboot.
Hope this helps!
From MSDN forums:
Please open Windows Explorer, and navigate to <Visual Studio Installation Path>\Common7\IDE
Devenv.exe /SafeMode: Launches the IDE in safe mode loading minimal windows.
Devenv.exe /ResetSettings: Restores the IDE's default settings, optionally resets to the specified VSSettings file.
Devenv.exe /ResetAddin: Removes commands and command UI associated with the specified Add-in.
Devenv.exe /ResetSkipPkgs: Clears all SkipLoading tags added to VSPackages.
If still no help, I suggest you try repairing your Visual Studio installation or uninstall it and then reinstall it. If you want to reinstall it, I am afraid that you need a DVD or a fine Internet.
Doing the first three steps works for me.
I got "lucky" and restarted Visual Studio 2013 and it worked. I have had other errors in which deleting the temp cache items cleared it up.
Side note. While Visual Studio 2015 is not perfect as of yet, and NuGet has become less friendly to use IMO, if my computer is restarted by the company domain network administrators OR especially when there is a computer losing power with a brown-out of some loss of power Visual Studio 2013 becomes a bit a "fun" to fix while Visual Studio 2015 projects for months seem to just open just fine as if nothing happened when I login.
In my case, I solve this problem by removing the Read-only attribute of the folder "Visual Studio 2015" in <C:\Users\myuser\Documents>.

Does creating an offline package for Visual Studio 2012 Update 2 include updates from Update 1?

I downloaded VS2012.2.exe and ran it via:
VS2012.2.exe /layout
to get an offline version of the installer.
Now I'm wondering whether this includes the whole set of updates ever since the RTM of Visual Studio 2012 or only those since Update 1.
The description on the download page isn't exactly unambiguous:
This update is the latest in a cumulative series of feature additions and bug fixes for Visual Studio 2012.
Cumulative makes sense, but the baseline isn't mentioned.
From: http://support.microsoft.com/kb/2797912
Visual Studio 2012 Update 2 is a cumulative release that includes the new features and fixes that were delivered in Visual Studio 2012 Update 1.
The answer is in cumulative word.
From wikipedia description of "Service pack":
A service pack can be "incremental", meaning it only contains the updates that were not present in the previous service packs, or it can be cumulative, which means it includes the contents of all its predecessors.
so, it is whole set of updates ever since the RTM of Visual Studio.
You can download and iso with the update created by microsoft, visit
http://blogs.msdn.com/b/visualstudio/archive/2013/05/03/announcing-availability-of-isos-for-visual-studio-updates.aspx
http://go.microsoft.com/fwlink/?LinkID=298533
Update:
Download Visual Studio 2012 Update 4 (Offline Installer / ISO)

How to use MSBuild to target v110 platform toolset?

I am developing a command line application that creates a full Visual Studio 11 solution made of a single VC++ project and that tries to compile it in the end using MSBuild.
The problem I am facing is strange.
If I execute my command line program inside Visual Studio 11 it works; if I instead launch it outside the development environment it throws me the error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(511,5): error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected. [f:\ABC.vcxproj]
The command I am using is the following:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe f:\snake\W9A30040.vcxproj /property:PlatformToolset=v110;Configuration=Debug /v:quiet
But I have the feeling that PlatformToolset=v110 is ignored and MSBuild use v100 (Visual Studio 2010).
Do you have any suggestions how to tell MSBuild to compile for v110 Platform Toolset?
I ran into the same problem as well with the full release of VS 2012. You can also set the VisualStudioVersion as a property with MSBuild as opposed to dealing with environment variables as mentioned in the accepted answer. For instance:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe .\myproject.vcxproj /p:VisualStudioVersion=11.0
The environment variables approach I'm sure work just as well, I honestly didn't try that as I was trying to stay away from having to modify the environment variables.
Make sure that the top of your .SLN file looks like this:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
When you double-click on the solution file, it's the # Visual Studio 2012 that controls which version of Visual Studio is loaded (and controls the icon displayed in Windows Explorer).
However, when you run MSBuild, it looks at the Format Version 12.00 part.
Confused?
This is confusing, since Visual Studio 2010 is version 10.0 and Visual Studio 2012 is version 11.0 (not 12.0), and using the version 12.0 solution file format causes MSBuild to (implicitly) set VisualStudioVersion to 11.0.
I found a workaround for this issue; could be a problem of Visual Studio 11 Beta that will be resolved before official release.
Anyway, if you are interestedm just set the environment variable "VisualStudioVersion" equal to "11.0" before calling MSBuild.exe.
In batch files
set VisualStudioVersion=11.0
or in VB.NET
Environment.SetEnvironmentVariable("VisualStudioVersion", "11.0")
Starting with Visual Studio 2013, MSBuild is now part of Visual Studio, and the correct path should be $(MSBuildToolsPath) (“C:\Program Files (x86)\MSBuild\12.0\Bin”). If you use msbuild.exe from the .Net framework folder (“C:\Windows\Microsoft.NET\Framework64\v4.0.30319”) it will not able to distinguish the vs2012 and vs2013 versions.
Use the menu based options to do this. From VC++2010 Express:
- Right click on the main file of the project (not the solution itself at the very top of the tree).
- Click General.
- Find Platform Toolset on the right side of the dialog, top half.
- Change from v110 to v100.
- Click OK.
----- Done ------
Microsoft provides a batch file to set all the EnvVars
You find it in the Start Menu under "Microsoft Visual Studio 2012/Visual Studio Tools" or in the Visual Studio folder ("C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat")

Resources