Linq to Sql Classes missing from within a script task in visual studio 2013 in an SSIS package - linq-to-sql

I'm trying to migrate an existing Visual Studio C# project to run in a script task in an SSIS package.
The current C# console application uses "Linq to Sql Classes" to generate a dbml file and the necessary classes.
But when I go to edit the script task in the SSIS PACKAGE I'm not able to find the LINQ TO SQL CLASSES. I right click on the project and select "add -> new item" and look for the "Linq to Sql Classes" item to add the dbml file to my project but it's not there?
Confusing because if I do the exact same thing in Visual Studio 2013 in a console application, I'm able to add the "Linq to Sql Classes". Does anyone have any ideas? I realize I could use Entity Framework but that would take a considerable amount of time to re-write everything. Also I've thought about just executing the console application's compiled executable from within the SSIS package but our database team will not allow packages to run executables.
Also I'm targeting the .net framework 4.0 for both the Visual Studio 2013 console applications and from within the Visual Studio 2013 editor in the SSIS Package Script Task.

I stumbled across this question because I have(had) this exact same problem. We had an existed DataContext file which had been mapped to a database. I had updated the database which SSIS but my changes werent being reflected in the Script task. I created a seperate project and created a linq-to-sql file and connected it to the same database as my Script task. Then added all the existing tables and the new one too. which generated a new Datacontext file. I then copied the code back into the original Datacontext file within the script task.
Hope this helps you and future programmers

Related

How do I edit SSIS Script Tasks in Visual Studio 2019?

Using the SSIS Data Tools extension for Visual Studio, it is possible to carry out various operations in a straightforward manner. However VSTA and the Script Task are a major exception—specifically in VS 2019.
After editing an existing Script Task the script text will reset to the default value.
Creating a new Script Task (other than the default) is likewise impossible, as far as I can tell.
I have tried editing the base64 string in which the VSTA task is stored within my .dtsx files.
After that I tried manipulating the files and directory structure under the VSTA temp directory in order to persist changes in the scripting solutions/projects. I have also tried many other tactics, such as including the task implementation as an additional source file, as a binary reference, or via partial classes, a base class etc., within the Script Task.
But none of these approaches (even if they were to work) are necessarily maintainable or simple in the context of a team.
Is there any sustainable long-term alternative that allows Script Task development in VS 2019?
The SQL Server Integration Services Projects extension for Visual Studio 2019 has a fix.
Script Task creation and editing appears to be working as of version 3.2.1 of the extension.
This was apparently released some time in the past few weeks (as of date of writing, 26 November 2019).

Generate the EDMX backing files in Visual Studio 2019

After modifying an EDMX in Visual Studio 2019, it saves the EDMX properly but does not generate the C# files.
This is a database first functionality, is there a new trick in VS2019 to actually generate the C# files on save?
I was going to write a feedback to Microsoft but the same question is asked on their network. The issue was
VS 2019 Preview2-Preview 4.2 after saving EDMX code is not generated
It is marked as resolved for VS2019 16.1
https://github.com/aspnet/EntityFramework6/issues/705
It is also mentioned in the bug that you may run the custom tools manually on all the EDMX, and *.tt files to generate your templates. And this works.

Is there a version-specific compilation symbol when SSIS compiles script components?

I have packages that use script components as a data source. Some of them override the PrimeOutput method from the Microsoft.SqlServer.Dts.Pipeline.ScriptComponent class. In 2008, this method has 3 parameters, but starting in 2012, it now has four parameters.
These packages are currently executing under SSIS 2008, but will soon be moved to SSIS 2014. I need to open these packages up and fix the issue, but I would like to do it ahead of time and still be able to deploy to SSIS 2008, but also have them work under 2014 when the new environment is ready without having to make additional changes when moving between environments.
If I could differentiate between environments at compile time, then I can get around this problem, but that would mean I would need to use preprocessor directives. I know I can define them in the script component's project file, but I'd like this to work in SSIS 2008 and SSIS 2012 without having to make changes to the .dtsx file.
Does anyone know if the various versions of SSIS define version-specific directives when compiling script components?

TFS Build partially succeeded when LINQ to SQL is added

VS2008 / TFS Build 3.5 / Ent Lib 4.1
I have a rather large solution that contains several apps. They are all currently using Enterprise Library (v.4.1) for their data access layer.
I added and locally tested a new data access layer that uses LINQ to SQL- it was fast and easy to add and the test went fine. But...
When I checked in the project, it would not complete the build - I get a "Partially Succeeded". There are some warnings, but those exact same warnings were there prior to the build failing.
I took the data access class back out (along with the code that calls it) and rebuilt and it builds fine.
I then added an empty new class and put a single variable in it and referenced it from the code. That built. I then created a new LINQ to SQL class in that new project and did not even reference it. When I checked that in, the build failed again with the "Partially Succeeded" message. No extra errors or warnings.
I love LINQ to SQL, I have used it in a few projects outside of this system, but I now have many hours into attempting to get this to build with no success.
Are all the same tools/libraries installed on the build server as on your desktop - Perhaps the server doesn't have the same vs or .net service pack level? Try running the build "manually" on the build server - load up the solution in Visual Studio on the server and execute the build within the IDE rather than under the TFS build system - this may report problems that you don't see so easily in the automated build.
Check the build log. Visual Studio often reports errors in the output pane text or build-server log text that are not picked up by the GUI error windows. So you will think a build succeeded but an output file has "quietly" not been generated. TFS build logs are usually huge so they are a pain to work through, so start by searching for keywords like "error" or the name of the project that fails rather than trying to read through line by line.
OK, we found it. The issue is on stack overflow elsewhere at
Visual Studio Setup and Deployment build fails with no errors
The issue is a bug in MS setup and deploy that breaks when it hits a line in the project that uses Linq. You have to comment out a line in the project to get it to work. Amazing, ridiculous, and no surprise.
Thanks for the input, it was that input that helped us get to the eventual answer (already on StackOverflow, but didn't have Linq in the title).

How to create a MS Word document using SSIS package?

Using Script Task, I have written a code to create a folder and create a MS Word document inside the newly created folder. It is working on the local machine but it is not working on the server where the package is deployed to. The folder is created successfully, but the Word document file is not created. For Word document creation, I had to refer another DLL where I had included an additional namespace Microsoft.Office.Interop.Word. Is there anything else to do before deployment ?
Based upon rfonn's comments, your choices are as follows:
Install Word 2007 on the server.
Re-do your package on a dev box with Word 2003 installed and deploy to your server.
Use some other tool to generate the Word Document.
SSIS is generally used for movement of data, so while it is possible to do what you are doing, it is likely not the best tool for the job. If you are capable of writing code in a script task to do what you want in SSIS, it is possible to write a program (VB or C# or any other tool you choose) to do the same thing without SSIS being wrapped around it. My money is on option #3 being your best choice.
I guess you missed installing the Office PIA.
After installing the relevent PIA according to your Office version, add a reference to microsoft.office.interop.word (.NET) file in your project (ssis script in VS).