Visual Studio 2017 SSIS Error (0xc001f041) - sql-server

No matter which SQL Server version I use I get the following error when I try to drag common tasks (like Send Mail) into the Package:
Failed to create the task.
Cannot create a task from XML for task "", type "" due to error
0xC001F041 "Cannot create a task from XML. This occurs when the
runtime is unable to resolve the name to create a task. Verify that
the name is correct.". (Sequence Container)"
I have no clue as to why that is happening and couldn't find any information on the internet either.
The strange thing is that I can drag the same tasks into the package when I use solutions that we've developed based on Sql Server 2008 R2 years ago. Restarting the machine didn't help. I could try to repair the Visual Studio installation, but I don't really want to lose all of my settings, extensions and such.
Apparently it works fine for a colleague. I deleted all .tbd-files in AppData/Local/Microsoft/VisualStudio, but neither of those files gets recreated when I start Visual Studio. I also tried to restore Toolbox defaults.
Executing the following command didn't help either. The same error is still appearing whenever I try to drop about 3/4 of the tasks into the package.
devenv /ResetSettings
devenv /setup
devenv /resetskippkgs
devenv.exe /InstallVSTemplates

Apparently the only thing that actually helps is to repair VS.

Related

C# code disapeared from script task after saving with "There is a compilation error. Do you want to save anyway" message

I am using VS2015 for SSIS development. My package consists of a script task which is very complex (has a number of classes and tricky logic). I made some modification to a class (in the script task), saved the modification, and wanted to close "Microsoft Visual Studio Tools for Applications 2015" which is used for working with C# code in SSIS. I received a VS message that my code had a compilation error, and it gave me a choice of "saving" anyway\"not saving". Since I was running out of work time, I hit "Save" and thought I would deal with the issue later.
Now when I open my SSIS project->script task, I can see that all my classes have gone. There is only one auto generated "ScriptMain.cs" that can be found.
Is there a way I can restore all my work? I cannot believe all code can just disappear if you press "save file" when a compilation error.
Any help is appreciated!
There are many thread in the Visual Studio developer community talking about a software bug found in Visual Studio 2015 and 2017 and it is mentioned that is fixed in the latest releases. I don't think you can try anything more than searching the Script Task project temp directory and the package bin folder if it contains an old version of the package.
The issue was mentioned in the following links:
Developer community - SSIS Script Task losing code
Developer community - Script task losing code
MSDN - Script Tasks losing code for Visual Studio 2015
Developer community - Script Task losing code in SSDT 15.8.0
All links mentioned that you have to install the latest release in order to prevent the error from occurring next time.

Cannot debug a script task

I exported a package from the production server (.ispac) to my local computer and opened in SQL Server Data Tools 2015 since I need to make some changes in the work flow. This package also include a script task which I need to alter and debug.
I added a break-point in the code, the problem is that when I run the package from Data Tools, VS 2015 opens but the below error is show and VS 2015 closed immediately and therefore I an not able to debug the code.
I have been trying to solve this for a couple of hours and viewed various post but no success.
I already: Set Run64BitRuntime = False
If I remove all the breakpoints and run the package all tasks will succeed but the script task is not doing what it is intended for... (this is why I need to debug).
I am stuck and not able to fix the code!
This is a reference issue. The references (dll's) version on your production server are different from the installed dlls on your loxal computer.
Try removing all reference used inside the script task and adding them again.
useful links
https://mitchellpearson.com/2015/04/13/upgrading-script-tasks-in-ssis-target-of-invocation-on-script-task/
DTS Script Task Runtime Error: Exception has been thrown by the target of an invocation
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/78373e2b-b4ea-4ce2-9590-b624a284d538/runtime-error-exception-has-been-thrown-by-the-target-of-an-invocation-from-script-task?forum=sqlintegrationservices
"Runtime error Exception has been thrown by the target of an invocation" from Script task

CS2001 Missing AssemblyAttributes.cs when executing SSIS package deployed to the server

I created SSIS packages and used the Integration Services Deployment Wizard to deploy it out to the server. I'm manually going to the Integration Services Catalog access through SQL Server 2012 and right-clicking and executing my package.
However, the package keeps failing and I'm getting the following errors when I check the execution report's messages.
They appear to be failing on data tasks where I have script components.
Assign :Error: CS2001 - Source file 'C:\Windows\TEMP.NETFramework,Version=v4.0.AssemblyAttributes.cs' could not be found, CSC, 0, 0
Assign :Error: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors.
This answer is a more detailed version of UberDoodles answer.
In Windows Explorer.
Navigate to C:\Windows\Temp\
Right click the folder and select properties
Go to tab Security, choose Advanced
On the default tab Permissions, choose Change Permissions
For the relevant Permission entry, choose edit.
By default, I had 'allow' checked for Traverse folder / execute file, Create files / write data and Create folders / append data.
Also check 'allow' for List folder / read data and Take ownership.
Press OK, the window closes
Press Apply and confirm anything you need.
Additionally, the logged in user had already Full control, but when I changed this for the entry 'Users', it worked for me.
(based on microsoft file/folder permissions).
I had the same problem today, just on SQL 2016.
For me it helped to change the target server version in Visual Studio project properties from SQL Server 2012 to SQL Server 2016.
I was investigating the same issue, and I came across a solution here :
https://social.msdn.microsoft.com/Forums/vstudio/en-US/73e67f3a-c575-4c73-a71d-ed7a2aeabb50/csc-error-cs2001-source-file-cwindowstempnetframeworkversionv40assemblyattributescs?forum=msbuild
Basically, the account which the package runs under needs to have full permissions to the C:\Windows\Temp\ folder, so that it can create temporary classes.
It worked for me :)
I had the same problem. I first used Eric G. response and added the List and Read permission to the c:\windows\temp. After I got everything working I went back and removed that permission. I then redeployed my solution from Visual Studio, this time designating the deployment target as SQL Server 2014 (which was the environment I was using) using Martin's solution. I then reran the process, and it worked with the List and Read removed.
I kept it using Martin's solution, as I don't like to have special permissions granted if I don't need them.
Good Luck
[Visual Studio 2017 15.9.16]
I just restarted Visual Studio as Administrator and the issue disappeared, which confirms the permissions idea of the answers above but spared me all work.
It's not a quirk though, as per this question and its answer you need that kind of permission for several tasks, like profiling and debugging under certain conditions.
For the sake of completeness, this blog says you might incur in some security contraindication if run VS as administrator when opening third-party solutions.

T-SQL IntelliSense does not work on some solutions

I have a solution in Visual Studio 2013, where among the others I have also a Database project. This project contains some .sql written in T-SQL.
IntelliSence and Parse (SQL (on visual studio menu) > Parse) do not work. I have gone through this Troubleshooting guide and many question on SO, but nothing worked.
As I understand is something in project setting that I need to configure or some leftovers I need to clean.
Any suggestions ?
In brief
IntelliSence is enable
SQL CMD is Disabled
In SQL Server Explorer there is an entry (localdb)\ProjectsV12 containing my DB.
Other solutions opened on the same instance of visual studio work fine
ReSharper is installed but is not the issue (I also tried without it)
Note:
The solution (the one that has issues) was created in a previous version of Visual Studio.
Update 15/12/2015
After some digging I found out that the issue may has something to do with the .v12.suo file (which is located alongside with .sln file and is hidden). Copping this file from a similar solution (one that IntelliSence works) eliminates the problem.
Another workaround that it may help, is to go to the "Database Project" properties (right click on the project in Solution Explorer and then select Properties), on the Debug tab and press Restore Default in "Target Connection String". In my case this just changes the Initial Catalog= value to Database and like "magic" IntelliSence works again! (in some cases it may need to restart the Visual Studio)
After this even if I restore (using Edit) the "Target Connection String" to the previous values the IntelliSence continues to work.

SSIS package runs in Visual Studio but fails when executed from SQL Agent [duplicate]

This question already has an answer here:
Why does my ODBC connection fail when running an SSIS load in Visual Studio but not when running the same package using Execute Package Utility
(1 answer)
Closed 7 years ago.
Using SQL Server 2014 with Visual Studio 2013 Shell. Relatively new to using SSIS but have had success with creating and executing other packages.
I'm having an issue with one SSIS package in a project running without failing in the first few seconds of the job being kicked off by the SQL Server Agent. I have other packages in the same project that are scheduled and run as schedule with no issues.
The package in question runs with out any issues in Visual Studio, but when it is deployed it will not run. The package details are:
it runs an FTP task to pick up a Excel file from a remote FTP server
then runs a Execute SQL Task to truncate a table
then runs a Data Flow Task that loads the table with the data from the file that was just picked up.
Again this all works fine without errors in Visual Studio. Looking the debug logs in VS there are not even any warnings and takes a little over a minute to run.
I have rebuilt the package in a new package deployed it and it again won't run when deployed, same results. When the deployed package is run it fails right away within 4-15 seconds which is not enough time for it to download the file.
I have other packages doing similar tasks that are deployed and working just fine.
I've seen a couple of things in my searching for a solution but don't think they apply here:
There is only one user (me) and I have a proxy setup for SSIS Package Execution which is the same for all the packages. So I don't think it is a security issue.
The Access Database Engine 2010 (redistributable) installed, ACE I believe I seen it referred to. So I don't think it is an issue with drivers.
Anyone able help guide me in where I should be looking or what the issue might be? Any additional information needed? Much appreciated.
EDIT: Additional information from the log file for this job:
-1071611876 (Data Code)
SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0209303. There may be error messages posted before this with more information on why the AcquireConnection method call failed.
Data flow engine has finished a call to a component method. : 122 : Excel Source : AcquireConnections : 130832947393433501 : 130832947395273663
-1073450985 (datacode)
Excel Source failed validation and returned error code 0xC020801C.
One or more component failed validation.
There were errors during task validation.
So it was the 32-bit run time box needing to be checked in the SSA Job Step Properties Advanced tab. I think I might have saw that some place but figured it wouldn't apply since SQL Server, Office/Excel and ACE are all 64-bit in my system. But I guess Microsoft hasn't gotten around to making all the drivers 64-bit. Thanks for the help.

Resources