SSIS 2017 Upgrade issue - c#

We are upadating the packages(packages are in package deployment model) from SSIS 2012 to SSIS 2017. There are lots of script components in all the packages. When we are upgrading the packages we are having an error
Description: CS0234 - The type or namespace name 'Dts' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?), ScriptMain.cs, 14, 26 End Error
Configurations:
SQLserver 2017
Visual studio enterprise 2015 + SSDT 2015
We have tried different options of deleting and re-adding the assemble file in the script component. Looks like the Microsoft.Sqlserver.ManagedDts assemble file is having issues for 2017 version. When we upgrade the packages to SSIS 2016 the packages work fine.
When we try to run the SSIS 2016 packages from Sqlserver agent job in SQLSERVER 2017 it is trying to upgrade the packages to 2017 and throw up the similar error as above.
Any solutions would be appreciated.

We have a mix of straight SSIS and BIML generated packages all suffering the same issues. Again, struggling for answers
We did find a workaround, but it's far from ideal :
View code on the dtsx package
Find the Project node
Find the PropertyGroup node which contains the AssemblyName node
Add a TargetFrameworkVersion to this PropertyGroup, with a value of v4.5
Save
Now if you open the package you can build/Execute your package

I'd forgotten about this post, but just for some extra info Varigence supplied us with a pre-release of the next cut of the BIML language (around 2018-05-25) and our issues (at least the automated package build ones) had gone away

Related

Packages.config and PackageReference in Visual Studio

I'm helping a colleague who cannot get a Visual Studio WPF project to build in our TFS 2015 build server. I've pulled (get latest) the latest version of his code into my VS 2019 instance. I can't get it to build on my dev box. When I try to build the solution on my dev box I get errors like thing:
The tag 'ModernDialog' does not exist in XML namespace 'http://firstfloorsoftware.com/ModernUI'.
The tag 'Interaction.Triggers' does not exist in XML namespace 'http://schemas.microsoft.com/expression/2010/interactivity'.
When my colleague checks in changes into TFS, it fails with errors like this:
Unable to find version '5.2.0' of package 'MvvmLightLibs'.
Unable to find version '1.0.9' of package 'ModernUI.WPF'.
I started by trying to update the NuGet packages he had in the project, but that hasn't worked well. Even restoring back to the latest version doesn't build on my machine.
My colleague's approach is to rip all NuGet packages out of the Visual Studio solution, then look around to find the DLLs, then put them into the project and reference them in the project. It does build on his system but doesn't on the TFS build server.
So, I've been looking around for probable causes. I came across this Microsoft document Migrate from packages.config to PackageReference. I'm not familiar with either packages.config or PackageReference, but I get the feeling that PackageReference is the "preferred" way of including NuGet packages.
This raises problems. Currently our TFS build server's highest version of Visual Studio is VS 2015. According to the referenced article, VS 2015 uses packages.config files. Anything newer than VS 2015 uses Packages (PackageReference I presume).
I've compared the failing WPF solution with another one I've worked on which builds fine on the build server. The solution that builds, I'll call it SolutionA, has a packages folder at the root of the solution, but it also has packages.config files in each project in the solution. The solution that fails to build, I'll call it SolutionB, has the packages folder at its root, and one packages.config file in the unit test project. (I think the unit project builds fine.)
Even though we're working with newer versions of Visual Studio, I suspect that the problem the build server is having is due to the build server having an older version of Visual Studio. We have a limited number of licenses for Visual Studio, so I can't put a newer version of Visual Studio on the build server. So, how do I get those packages.config files into each projects?
First, your solution actually uses packages.config nuget management format. And this format makes every project has a file called packages.config which lists all the nuget packages and their versions. That is the feature of packages.config nuget management format. So you should also make sure that you have commit that file into TFS.
Second, that migrate packages.config into PackageReference is not an easy work and it should be done with VS IDE. Mostly, you have to make a big change to every csproj file of the project. Actually, PackageReference is flexible and lightweight, it does not have the packages.config file and packages folder which stores all the nuget packages. Just embed them directly in proj file. And so far, PackageReference is the mainstream.
Your problem is that you did not do a nuget restore operation on TFS build to make the missing nuget packages under the packages folder so that build process will find those nuget packages and make them work.
You should add a nuget restore xxx\sln command line or task.
Please check one,two,three.

Downgrading .NET Framework causing packages issues

I am working on a project on TFS. This project was created on someone else's PC on VS 2017 and the newest .NET framework and published to Azure.
I got the project on my PC, I have VS 2015 and I had to change the .NET framework of the project to 4.6. Everything was fine, I could make changes to the project and commit.
But when I tried to publish to Azure from my PC, I got a very unclear error:
Publish Failed
Connecting to ...
Looking for solutions online, I had to downgrade the version of the package Microsoft.Net.Compilers from 2.6.1 to 2.4.0 . And that worked !
I turned off my PC. Next day when I opened the project and ran it, I got this error locally :
Could not load file or assembly 'Microsoft.ApplicationInsights, Version=2.6.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
I tried to uninstall Microsoft.ApplicationInsights and reinstall it with version 2.6.1 , but it says i need a newer version of nuget.
I am not sure how to proceed from here. I already installed all the updates in my Tools -> Extensions -> Updates but nothing changed.
Why are all these things happening to my project and how can i fix it?
PS: upgrading my VS to 2017 is currently not an option due to many exterior reasons.
Thank you.
I've gotten that error locally as well and was actually able to resolve by manually adding the file to my project folder, may be worth a shot.
Downgrading .NET Framework causing packages issues
Just like Hans said nuget packages change quite rapidly, which often require the latest version NuGet. Some new features in the package only supported by the newer NuGet (like PackageReference) or some issues fixed on the newer version. For example, install package Microsoft.EntityFrameworkCore.SqlServer 2.1.1 on Visual Studio 2015, which requires NuGet client version '3.6.0' or above.
So, the workaround for this issue is create a new project with Visual Studio 2015, copy the code from previous projects, then add those nuget package one by one to find out the reason why it needs the newer version nuget.
However, I want to talk more over about this question is that the best way to resolve this issue is to install Visual Studio 2017 alongside Visual Studio 2015. As we known, using a lower version of the Visual Studio and .net framework to open a higher version of the Visual Studio and .net framework is not recommended, it will always bring a lot of incompatibility errors and some other weird issues. Since upgrade your Visual Studio to 2017 is currently not an option due to many exterior reasons, so I suggest that you can install Visual Studio 2017 alongside Visual Studio 2015. Besides, developing the same project with different versions of Visual Studio and submitting it to the TFS server may bring many unpredictable risks.
Hope this helps.

Missing Assembly CS0234 WebJobs, CS0246 QueueTriggerAttributes when publishing Azure Webjob

After creating a new WebApp (WebJob) in Visual Studio 2015, I recently ran into an error, when I tried to publish the WebApp as WebJob to Azure, using the WebJob Publisher in Visual Studio.
The output always displayed the Errors:
CS0234: The type or namespace name 'WebJobs' does not exist in the namespace 'Microsoft.Azure'
CS0246: The type or namespace name 'QueueTriggerAttribute' could not be found
CS0246: The type or namespace name 'QueueTrigger' could not be found
I tried reinstalling and referencing the most current NuGet Packages which didn't result in success.
Finally, I found out, that my issues were solved using the Packages Version:
Microsoft.Azure.WebJobs v2.0.0
And Microsoft.Azure.WebJobs.Core v2.0.0
instead of the most current versions 2.1.0 at this point.
Perhaps you have an Idea if there could be any other Issues with this? Anyway, if you run into the same problem, the solution above helped me, but didn't satisfy me.
I tried reinstalling and referencing the most current NuGet Packages which didn't result in success.
Perhaps you have an Idea if there could be any other Issues with this?
I think your issue is more related with Visual Studio Version.
If I run the web job in VS 2015, I get the same result as you. We could see the default .NET Framework version just 4.5.1. The packages all old version. And this platform can not load the latest package correctly. It is not like VS 2017, it can not support the latest feature.
If I run the web job in VS 2017, every thing works fine. And we could load the latest package in VS 2017 correctly. If you really want to use the latest feature, you could download VS 2017 from this link.

Visual Studio 2017 Enterprise Add Unit Test project throws Package Installation Error

I have a solution with projects pointing to .Net Framework 4.5 which I have opened in Visual Studio 2017 and tried to Unit Test Project pointing to .Net Framework 4.5. I am getting the following error
Package Installation error .
Could not add all required packages to the project. The following packages failed to install from 'C:\Program Files(x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\502SXCIF.E5I\Packages':
MSTest.TestFramework.1.1.11: Failed to add reference to 'Microsoft.VisualStudio.TestPlatform.TestFramework'
I have tried changing the Platform to x86 as suggested on some online resources.
I am using a Windows 7 Enterprise 64 bit. Has anyone been able to resolve this.
MsUnit test related template got missed in your local system.if you have another version please try to copy respective folder it will resolve the issue.

Adding an ADO.NET Entity Data Model throws build errors

I am using Visual Studio 2013 express. I create a new project and then I add a database to that project. But, when I add an ADO.NET Entity Framework model to that project and then run the program, I get the following four build errors listed below. To try to remedy this myself, I added the namespaces 'System.Data.Entity' and 'System.Data.Entity.Design', but that didn't help. Also, I uninstalled and re-installed the Nuget package. I also uninstalled and re-installed Visual Studio 2013 Express for Windows Desktop. But these measures didn't help the situation either.
Please note that I used to use the Entity Data model just fine. But it was around the time that I did a system restore on my computer, and when I updated VS 2013 with an update offered on the start page, and finally, when I signed up for MS Azure, that I started running into the problem described above. Now I would think that uninstalling and reinstalling Visual Studio 2013, and then installing the 'Nuget' Package would solve all problems. What am I missing here?
The errors mentioned above are:
Error 1 The type or namespace name 'Infrastructure' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?) C:\Users\John\documents\visual studio 2013\Projects\Riches\Riches\RichesModel.Context.cs 14 30 DataLayer
Error 2 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?) C:\Users\John\documents\visual studio 2013\Projects\Riches\Riches\RichesModel.Context.cs 16 52 DataLayer
Error 3 The type or namespace name 'DbModelBuilder' could not be found (are you missing a using directive or an assembly reference?) C:\Users\John\documents\visual studio 2013\Projects\Riches\Riches\RichesModel.Context.cs 23 49 DataLayer
Error 4 The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?) C:\Users\John\documents\visual studio 2013\Projects\Riches\Riches\RichesModel.Context.cs 28 16 DataLayer
Thank you and I realize that my last attempt at this question was rather rough-draftish,
John
By opening 'Tools', 'Nuget Package Manager', 'Manage Nuget Package bySolution', then in 'Updates' uninstalling the check-boxes that show my dbase and its one table, and then, in the 'online' section, reinstalling with the purple-colored icon for the entity framework, then all of the references populated in the solution explorer for the EF and data extensions. And the compiler can find the library it needs to run. So the program runs fine now with the EF model added.
That other error window that you mentioned which was re: NuGet.VisualStudio.Interop I had gotten before I added Nuget at all. It was your pointing to adding Nuget to a particular solution that directed me to look in the 'Manage Nuget Package by Solution' item.
The evidence points to needing to install all of the updates manually, particularly from the Nuget Package Manager in addition to installing Visual Studio 2013 (Express). Say, for instance, if you have to restore your system to a point before you ran the update from your start screen. So in this case that you don't have access to that update from your start screen, you would now have to install VS 2013, then install Nuget from either 'tools' 'extensions and updates' or from 'tools' 'Nuget Package Manager', then install 'Entity Framework' from 'Manage Nuget Package by Solution'.
John
Install Entity Framework package by Package Manager Console. Open it (tools menu) and type:
Install-Package EntityFramework
Then let us know is it work now. (Entity Framework should be visible, when you expand References node in Solution Explorer)

Categories

Resources