0
votes

I have a visual Studion solution in which different SSIS packages are included along with class library project for custom component. The class library project has post build event which copies the .dll file into GAC and into PipelineComponent(C:\Program Files (x86)\Microsoft SQL Server\110\DTS\PipelineComponents). Now, when i open the visual studio solution and try to build class library project second time, it gives me an error possibly because the .dll file is already locked by visual studio which is used by other SSIS packages.

Now, how can i tell visual studio to not lock the .dll file? I tried to unload the SSIS packages, but it didn't work.

Please note that i want my class library project and SSIS packages in one solution.

1
What is the exact error message? Could you provide your post build macro?billinkc
Error 15 The command ""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\gacutil" /i D:\Haris\PRISM\ETL\Custom Components\Import\bin\Debug\WritingToDB.dll copy "D:\Haris\PRISM\ETL\Custom Components\Import\bin\Debug\WritingToDB.dll" "C:\Program Files (x86)\Microsoft SQL Server\110\DTS\PipelineComponents\WritingToDB.dll" /y " exited with code 1.Haris Iltifat

1 Answers

1
votes

You have a solution. Your solution contains 2 projects: one is a .NET class library project while the other is an SSIS project.

The problem you are running into is that you cannot overwrite the dll in the Pipeline Components folder as it is in use by the SSIS project. I ran into the same issue when I was developing custom components. I can't remember if it's the SSIS Toolbox that puts the lock on the file or a package actually using the component that locks it. I also don't recall what my final resolution was but I tried a variety of things.

My resolution

Exclude the SSIS project from your solution. You can either do this permanently by removing it from the solution or temporarily by unloading the project during your build phase. Ultimately, I went this route and created a separate solution with the SSIS project in it. This allowed me to unload the project in the other VS instance whenever I needed to redeploy the DLL. It also empowered me to put breakpoints in the SSIS project which allowed me to attach the VS debugger of the .NET and then debug into my custom component. Maybe they've fixed that since the 2005 days but at that point, you were stuck using 2 instances of VS to debug into your package.