Could not find Microsoft.Data.Tools.Components in VS2017 - c#

I successfully used VS 2015 (including c++ / c#) in the past and downloaded now the new VS 2017. Building the project, I got several warnings such as:
(1) Severity Code Description Project File Line Suppression State
Warning The referenced component 'Microsoft.Data.Tools.Components'
could not be found.
(2) Severity Code Description Project File Line Suppression State
Warning Could not resolve this reference. Could not locate the
assembly "Microsoft.Data.Tools.Components, Version=15.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL". Check to make sure the assembly exists on
disk. If this reference is required by your code, you may get
compilation errors.
(3) Severity Code Description Project File Line Suppression State
Warning Could not resolve this reference. Could not locate the
assembly "Microsoft.Data.Tools.Schema.Sql.UnitTesting,
Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=MSIL". Check to make sure the assembly exists on
disk. If this reference is required by your code, you may get
compilation errors.
I tried now several options. Actually, the solution explorer shows under references the "Microsoft.Data.Tools.Components". I then changed the .NET target framework from 4.6.1 to 4.5.1 and the reference path to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\Extensions\Microsoft\SqlDb\ without no progress.
Maybe, some could help .. many thanks.

Not sure if this would resolve this problem or if Sepp ever found a solution, but this problem sounds similar to one I had upgrading to 2017 on other projects. Adding updated MS Libraries via NuGet has worked for me.
Open NuGet Package Manager and search for Microsoft.Data.Tools to find Microsoft content similar to Microsoft.Data.Tools.Components.
There are two similar entries Microsoft.Data.Tools.UnitTest and Microsoft.Data.Tools.MsBuild
Try adding maybe the Microsoft.Data.Tools.MsBuild or both to your solution and recompile. These libraries sound like they are the same base, and may include the 'Component' content also. A Google found the same issue (i.e. https://social.msdn.microsoft.com/Forums/en-US/09f82922-2fe5-46cc-bc70-b63f137aec28/visual-studio-2017-warning-issues-?forum=vssetup, and the Microsoft.Data.Tools.MsBuild package includes content similar to that mentioned both above and there. The MsBuild states: "You can use SSDT Transact-SQL design capabilities to build, debug, maintain, and refactor databases." - so I'm thinking this may be an update to your older set. If it doesn't work, just unselect them to uninstall.

Related

Warning CS8032 Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.3.0.0

Getting the following warning. Projects loads and runs ok but I don't know how to get rid of this warning.
Visual studio 2019, WebForms.
Warning CS8032 An instance of analyzer Microsoft.CodeAnalysis.Analyzers.MetaAnalyzers.EnableConcurrentExecutionAnalyzer cannot be created from
C:\Web Directory\VenueManagementSystem\VMSstartup\packages\Microsoft.CodeAnalysis.Analyzers.3.3.0\analyzers\dotnet\cs\Microsoft.CodeAnalysis.Analyzers.dll
: Could not load file or assembly 'Microsoft.CodeAnalysis, Version=3.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.. VMSstartup C:\Web Directory\VenueManagementSystem\VMSstartup\CSC 1 Active
I think you experience the same issue with this one on github
Check your package.config file for an instance of Microsoft.Net.Compilers and try to upgrade to the latest version (this should do the trick).
In any case, I don't expect this to affect your application whatsoever. This is just related to static code analysis for your project and has nothing to do with your runtime execution.

WPFToolkit.Aero2 failed to load

I get this error when debugging:
Managed Debugging Assistant 'BindingFailure' : 'The assembly with display name 'WPFToolkit.Aero2' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'WPFToolkit.Aero2, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.'
I tried uninstall the Extended WPF Toolkit nuget (3.3.0) and install again. didn't solve.
What am I missing ?
I am using VS Enterprise 2017 version 15.5.7, .NET 4.7.1.
The exception is when I debug Managed debugging assistant on the upper
line of my Xaml.
My references are:
just had the same issue, while using the WPFToolkit.Extended (standalone, old version)
fixed it by removing the reference I had, and installing the nuget you refer to.
my current references look like this:
Note, that I don't reference "WPFToolkit", while you - do.
I would say, try removing the "WPFToolkit" reference, see if it helps.

There was a conflict between "mscorlib, Version=4.0.0.0" and "mscorlib, Version=2.0.5.0" [duplicate]

On a new Win8.1 reinstall, with all of my code restored from backup, I'm suddenly now getting a Visual Studio warning when I build the main project of my solution:
Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.
I set the Output log level to Detailed and I found a few entries like this:
There was a conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes". "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" was chosen because it had a higher version.
Trouble is, I'm not referencing mscorlib anywhere in the solution—old or new. I have a couple of apps on my machine that require .NET 3.5, but I can't see how that could be related.
One difference: the old Win8.1 install on which this warning did NOT occur was a standalone machine; this time I'm domain-joined. I don't know whether that makes a difference (I can't see how), but I thought I ought to mention it at least.
Having different versions of a Nuget package on different projects may cause this problem as well. Make sure that all your packages have the same version:
(Within Visual Studio) Right click on the solution
Click on Manage Nuget packages for Solution
Click on the Consolidate tab
For every package in the Consolidate tab, update the package to the same version for every project.
I was able to fix this by issuing an update-package -reinstall command at the Package Manager Console.
BUT
Be careful, updating all the packages in your solution could cause other problems, make sure you can roll back to a good version if it goes wrong!
I have been able to fix this issue by deleting my ".suo" file of my solution and then re-opening the solution. I then rebuild the solution and the issue is gone.
The ".suo" file is within the ".vs" folder which is what I usually delete.
Good luck!
I solved this by setting my verbosity to Diagnostic as per this answer.
Once I did that and rebuilt my solution, the build log actually listed the specific packages that depend on the two different versions of mscorlib.
In my particular case, my project had references to version 2.0.20126.16343 of System.Net.Http. I opened up the NuGet Package Manager and updated this package to the latest version (4.3.4 at the time). The next time I built my solution, the warnings were gone.
Well my solution is a little bit simpler than all of the above. I simply added a reference to the two Assemblies throwing this error (System.Runtime.Serialization and mscorlib) and rebuilt the project. By doing this, I specified the 4.0.0.0 version and removed the ambiguity.
One of the two (mscorlib) couldn't be added via the GUI because of the "A reference to 'mscorlib' could not be added. This component is already automatically referenced by the build system." error.
I needed to open the .vbproj (.csproj) file and add a reference manually via:
<Reference Include="mscorlib" />
I've tried all the following, but none has resolved the issue.
the command "update-package -reinstall".
Update and package via Consolidate tab.
Removing the ".suo" file.
However, My issue was a different case, I guess the new version of Xamarin.Forms package has used a different version of mscorlib. so I've downgraded it and it works fine.
I suggest you try all above solutions and also try to find which package is conflicting.
Following Memet Olsen's advice using VS2017 community...almost identical:
Right click Solution in Solution Explorer.
Select 'Manage Nuget Packages for Solution'
Check the packages. If any of them have a blue up-arrow rather than a green tick use the 'update' button
I also have tried all of the proposed solution to no avail.
In my project, this warning message was caused by a dll reference having a dependency on a different .net framework than the one that is targeted by my project.
In order to find out which dll reference was causing the warning, I simply used .net reflector to explore each dll reference to find out which one was referring a different .net framework (mscorlib).
In order to fix the issue, the reference dll has to be updated to a version which targets the same .net framework as the project using it, if such a version exist.
Hope this helps.

Cannot build solution because of log4net dependency issues C#

I am currently working on my colleague's project that he wrote a few years ago. The project uses "log4net" assembly although I do not really need it or use it. Anyways, when I'm trying to build project, i get this error:
Severity Code Description Project File Line Suppression State
Error Unknown build error, 'Cannot resolve dependency to assembly 'log4net, Version=1.2.13.0, Culture=neutral, PublicKeyToken=9fea11e3513f1a42' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.' VersionChecker C:\windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets 268
I've tried to remove the assembly, and also tried to redirect assembly versions without luck. I don't find any trace to log4net anywhere in my project and don't have a clue how to remove it completely and manage to build my project..
Thanks in advance for your help!
Go to 'Manage Nuget Packages for Solution' from Tools menu of VS and check if you could uninstall it from there.
There are multiple ways of building projects. The most common way is to use Visual Studio only. If this is your case, then simply go through each project in your solution explorer and expand references. You should see all the references to your project. Simply highlight Log4Net and press the delete key. You'll need to go through all the code that references Log4Net and remove it.
The other scenario is that you're using an external build script, like msbuild to do additional compilation. If this is the case you'll need to wade through your build scripts. The details vary among implementation, but a starting point is to simply highlight the project in question in the solution explorer and press alt+enter to bring up the properties. Check the build events tab for additional build script info.

Error using VS 2015 code analyzers

Using Visual Studio 2015 RTM, I have a .NET 4.0 class library project.
I've added the Microsoft.CodeAnalysis.FxCopAnalyzers NuGet package to the project. This results in the following Analyzers being listed for the project in Solution Explorer.
Microsoft.AnalyzerPowerPack.Common
Microsoft.AnalyzerPowerPack.CSharp
System.Runtime.Analyzers
System.Runtime.CSharp.Analyzers
System.Runtime.InteropServices.Analyzers
System.Runtime.InteropServices.CSharp.Analyzers
However in the Error List window, the following error appears:
Unable to load Analyzer assembly
C:\Dev\git\MySolution\packages\System.Runtime.Analyzers.1.0.0\analyzers\dotnet\cs\System.Runtime.Analyzers.dll
: Could not load file or assembly 'System.Runtime.Analyzers,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. Strong name validation failed. (Exception
from HRESULT: 0x8013141A)
(and similar for System.Runtime.CSharp.Analyzers and System.Runtime.InteropServices.Analyzers)
The first two analyzers do work correctly, but I'm not getting anything for the last four (probably related to the above errors).
Is there a way to get these to work, or is it possibly related to the project being .NET 4.0?
Thank you for reporting this issue. The System.Runtime.* analyzer assemblies uploaded to nuget are indeed only test-signed, and hence cause the assembly load failures. We are working uploading newer nuget packages for System.Runtime.Analyzers and System.Runtime.InteropServices.Analyzers which will have signed assemblies.
Meanwhile, you can get the non System.Runtime based FXCop analyzers by installing "Microsoft.AnalyzerPowerPack" from here: https://www.nuget.org/packages/Microsoft.AnalyzerPowerPack/. These do contain all signed assemblies and should work fine.
I'll post an update on this thread once we have uploaded signed System.Runtime analyzer packages.
Sorry for the inconvenience and thanks again for reporting it!
Regards,
Manish

Categories

Resources