For some unknown reason Visual Studio 2022 unable to find very common Assemblies System, system.core and more. Looking at SDK I was able to find all missing Assemblies, but Visual Studio 2022 is not happy.
MSB3644 The reference assemblies for .NETFramework,Version=v4.0 were not found
Related
I have tried to switch to Visual Studio 2019 since it is now officially released, but I am having problems building a C++/CX based project.
I have not retargeted the project, but it is still configured to use the v141 platform toolset, i.e. Visual Studio 2017 Build Tools.
As far as I can tell, I have specifically installed the required build tools in Visual Studio 2019, which should be evident here:
Still, according to the project properties, Visual Studio 2017 Build Tools are not installed:
And when I build the project I get the following error:
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(378,5): error MSB8020: The build tools for Visual Studio 2017 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install Visual Studio 2017 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".
Am I still missing some components in my installation, or is this a bug in Visual Studio 2019?
EDIT I should point out that I still have Visual Studio 2017 installed on the same computer as well.
I had a similar issue, but this is what I was missing.
You will find these options on the Workloads tab of the VS installer on the right under Installation details (i.e. not under Individual components).
It turns out that the (Windows Runtime Component) project was not properly set up. In the .vcxproj file the ApplicationTypeRevision element was missing, which is also "evident" (if you know what you are looking for...) from looking at the project properties above, where only the General configuration properties node is visible, and the Target Platform value is empty.
Inserting the following line in the .vcxproj file immediately following e.g. the WindowsTargetPlatformMinVersion element should do the trick:
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
Most likely, it was also necessary to add the C++ Universal Windows Platform Tools. The v142 version was made available when trying to create a new C++ Universal Windows Platform project. As far as I could tell, this component was not otherwise visible in the Visual Studio Installer? Once the v142 component was installed, the corresponding v141 component was also available for installation.
I had this same problem for Visual Studio 2017, even though V141 was explicitly shown as installed. It turned out the problem was that VCTargetsPath was set in System Environment Variables to "C:\Program Files (x86)\MSBuild\Microsoft.Cpp\V4.0\V140". Removing or unsetting this variable solved the issue.
I suspect this variable was set during an earlier install of Visual Studio 2015. Even after uninstalling all other Visual Studios the variable was never removed and the problem persisted.
I have a visual studio extension (deployed as .vsix) that needs to support both Visual Studio 2013 and 2015.
The problem is that the extension needs to talk to TFS so it uses the TFS client libraries and in VS2015, these were changed from being GAC deployed to be a nuget package that the consuming app should redistribute.
How should I setup my VS package's references so that it works on both versions of Visual Studio?
I've tried several approaches:
Reference the 2013 GAC dll's: When loading on a VS2015 machine, these DLLs cannot be found.
Reference 2013 GAC dll's but also copy-local (bundle with .vsix): Some other dependency of those DLLs were missing.
Reference 2015 dll's (from nuget) and bundle with .vsix: Loads fine in both 2013 and 2015, but doesn't work in 2013 (actually using TFS functionality fails - for example a call to GetLocalWorkspaceInfo("c:\src\path") returns null)
I would:
Reference the 2013 assemblies, so that you ensure that you only use the API that's available in that version. (2015 is, of course, backward compatible.)
Add an AssemblyResolve hook so that you can load the 2015 assemblies in place of the 2013 assemblies, when they fail to load. Instructions for previous versions are available, but should be similar.
I think that option 3 will mostly work, but the reason your workspace can't be found is because 2013 and 2015 use different workspace caches. I suspect that you could surmount this by building another connection to the server and updating the workspace cache into the 2015 location. Though this points to deeper issues in compatibility: you would be unable to hook up event listeners for VS connection/workspace objects.
I had been using Microsoft.TeamFoundation.dll found in
"{programfiles}\Microsoft Visual Studio
10.0\Common7\IDE\ReferenceAssemblies\v2.0"
with visual studio 2010?
Been working on updating the build templates to TFS 2013 and found that the Microsoft.TeamFoundation.dll is missing in the
"{programfiles}\Microsoft Visual Studio
12.0\Common7\IDE\ReferenceAssemblies\v2.0"
folder.
Where can I find the Microsoft.TeamFoundation.dll for TFS 2013?
Found the answer at this location:
"My observation is, using TFS and VS version 2013 onwards, we no longer need to reference to this assembly where as referencing to assembly Microsoft.TeamFoundation.Common.dll is enough. This assembly contains Microsoft.TeamFoundation namespace and all sub-namespaces along with classes that represent general information about Visual Studio Team Foundation Server."
SOURCE
I'm unable to add sql compact as reference in Visual Studio 2010 Professional. The project setting is configured to use Target Framework ".NET Framework 3.5". Would anyone know why?
I just realized that I cannot add the sqlcecompact35.dll as a reference because it's not a valid CLR assembly.
I have a dll library built in Visual Studio 2010, but I need to include it in a VS 2005 project.
If I do it, I get the error message
This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
I googled the error message, but the only workaround I found is to replace gacutil.exe located in C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin with the gacutil.exe located in C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools.
I tried this way, but I'm still getting the same error.
You need to check which .NET framework the DLLs are aimed at.
You'll find that by default 2010 will be aimed at .NET 4.0 and 2005 will probably be .NET 3.0.
You can reference a .NET 3.0 library from .NET 4.0 code but not the otherway around.