FileNotFound Error while creating SSIS package programmatically using C# - c#

I am trying to write an SSIS package programmatically using C#.
I have installed SQL Server Integration Services Projects v16 and added all the references like Microsoft.SqlServer.ManagedDTS and using Microsoft.Dts.Runtime.
However, at runtime, I am getting an error:
System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.SqlServer.DTSRuntimeWrap, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.'
I tried to manually add the DLL "Microsoft.SqlServer.DTSRuntimeWrap" from "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\SSIS\160\Binn" but it throws the same error.
My Microsoft SQL Server Integration Services Projects is version 16.0.5035.3 and hence, I added the reference from the \160\Binn.
However, it seems that the code is asking for another version (Version=13.0.0.0).
Can someone please tell me what's going wrong?
Much appreciated!

Related

SSIS C# script won't run with reference to Newtonsoft.json

We have an SSIS package that executes a Script Component in the Data Flow Task. This script is in C# and it is referencing Newtonsoft.Json to connect to a website and get data from the website. This package was originally created in SSDT 2010, was deployed to a SQL Server 2012 instance, and ran successfully. We are in the process of migrating our SSIS packages to a new SQL Server 2017 instance and the package was upgraded to SSDT 2015. Now the package throws an error when trying to execute the Script Component. The error is:
Error: 0x1 at Get product meta, Error Getting Data From Webservice!: System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
File name: 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
at ScriptMain.GetWebServiceResult(String wUrl)
at ScriptMain.parsejson(String uri, Boolean& hasmore)
We've been Googling the error with very little success or understanding of the issue. Has anyone had this issue before and, if so, does anyone have any suggestions on how to resolve it?

Could not load file or assembly 'VMware.Binding.WsTrust'

I am trying work with the VMWare SDK to create a Windows service in C# & .NET that automates launching and stopping virtual machines in the VMWare Workstation. I have downloaded the SDK and referenced the necessary dll files in my project.
VimClient c = new VimClientImpl();
ServiceContent sc = c.Connect(serverURL);
UserSession us = c.Login(username, password);
IList<EntityViewBase> vmList = c.FindEntityViews(typeof(VirtualMachine), null, null, null);
I'm attempting to run a basic example but when attempting to connect to the service, I encounter the following exception: "Could not load file or assembly 'VMware.Binding.WsTrust, Version=12.2.0.3593, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
When running as a Console Application in .NET Core, I get a similar exception: "Could not load file or assembly 'VMware.System.Private.ServiceModel".
I have tried copying over the runtime dll's from the nuget packages in my user folder and modifying my .csproj file to include these dll's, but I am still encountering the exceptions.
I am using .NET Framework 4.7.2. and my Target OS is Windows 10.
Assemblies added:
InternalVimService50.Wcf
InternalVimService70.Wcf
InventoryService55.Wcf
VimService.dll
VMware.Vim.dll
VmWare.Binding.Wcf
Stack Trace: StackTrace = " at
VMware.Vim.VimClientImpl.CreateClientChannel()\r\n at
VMware.Vim.VimClientImpl.Connect()\r\n at
VMware.Vim.VimClientImpl.Connect(String serviceUrl)\r\n at
VMWareServiceTest.Service1.OnElapsedTime(Object source, ElapsedEventArgs e) in C:\\Users\...
Exception Message:"Could not load file or assembly 'VMware.Binding.WsTrust, Version=12.2.0.3593, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
Any help would be greatly appreciated, thank you.
(First post on SO, but regular user of all the wonderful wisdom)
I just had this same issue trying to learn how to interact with vSphere using .Net.
Solved it by building vsphere-ws\dotnet\cs\samples\VMware.Binding.WsTrust from the VMware vSphere SDK, and then adding a refrerence to the resulting dll to my project.
I just loaded the Samples2012.sln in Visual Studio and build that particular project.
Involved versions:
PowerCLI 12.0.0 build 15947286 (Not sure if needed, but this is where I referenced VMware.Vim.dll)
VMware vSphere SDK 6.7U3 (6.7.0-14379537)
Visual Studio 2019 (16.8.2)
.NET Framework 4.8
Windows 8.1
Hopes this helps.

Remote language server can't activate when I open ASP.Net MVC solution

Recently, my ASP.Net project have been giving me issues, as soon as I open the project it displays the error:
There was an error activating the remote language server, C#/Visual Basic Server Client. For more details, please examine the ActivityLog.xml file.
I examined the ActivityLog.xml file as it suggested, and from the Activity Monitor Log I found the following errors:
#182: Still unable to load MEF component DLL: Could not load file or assembly 'Microsoft.Windows.Simulator.Client, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
c:\program files (x86)\microsoft visual studio\2019\community\common7\ide\commonextensions\platform\diagnosticshub\Microsoft.DiagnosticsHub.VisualStudio.Package.dll
#183: Still unable to load MEF component DLL: Could not load file or assembly 'Microsoft.UniversalApps.Deployment, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\EXTENSIONS\MICROSOFT\GRAPHICS\DEBUGGER\VsGraphicsDebuggerPkg.dll
I tried to repair VS2019 with hopes it will fix this error, but it didn't work. And I'm using the latest version of VS2019 (version 16.8.3).

Microsoft.CodeAnalysis failed to load file

I have downloaded sample Asp.net project from the git repository and try to build in the local machine VS 2017
below is the error it is showing
Error CS8032 An instance of analyzer
Microsoft.AspNetCore.Mvc.Analyzers.AvoidHtmlPartialAnalyzer cannot be
created from
C:\Users\avinash.nuget\packages\microsoft.aspnetcore.mvc.analyzers\3.0.0-alpha1-10670\analyzers\dotnet\cs\Microsoft.AspNetCore.Mvc.Analyzers.dll
: Could not load file or assembly 'Microsoft.CodeAnalysis,
Version=2.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The system cannot find the file
specified.. MusicStore E:\LearningTools\sampleapp\MusicStore-master\MusicStore-master\samples\MusicStore\CSC 1 Active
And here is the link for the git repo: https://github.com/aspnet/MusicStore for project reference.
What may be the issue in my machine or any missing file/lib in the framework?
It seems you do not have a dot.Net core SDK installed on your machine. Try installing the SDK and verify.
Thanks,
SK

Add Reporting.WinForms Reference to VS2015

I'm looking at adding the reference;
Microsoft.Reporting.WinForms
to my VisualStudio (2015) project but when I go to Add the Reference in the Solution Explorer I couldn't find it.
Eventually I added it through NuGet but now I am getting the error message;
Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
which leads me to believe I just haven't added the package properly. I've installed Microsoft SQL Server Data Tools through program features but still no luck.
What am I missing?
You can try by executing this into Package Manager Console
Install-Package Microsoft.Reporting.WinForms.v11

Categories