Could not find a part of the path in 'C:\' at line 0
Asked Answered
P

4

4

I am stuck with an error on Script Task in SSIS package. I could found similar questions but they are different from my scenario.

Build the Script and which was failed with following error (for Error list please refer following image):

Severity Code Description Project File Line Suppression State Error Could not find a part of the path 'C:\Users\name\AppData\Local\Temp\2\Vsta\166f3f6a0a3b4d2b9bce8275652e86c5_out'.
ST_e39a74fadbb04a8088f3dcc732f67cf0 C:\Users\name\AppData\Local\Temp\2\Vsta\SSIS_ST140\VstagyjdfDg98EOThQux2q_T5A\VstaFGRuzNpZdEeMuG1swXzy5g\mscorlib 0

Error List:

Error from error list

I can understand this error that File not found in the path. OK. I can change path, but it shows line: 0. When I click the error I have following notification.

Message:

enter image description here

So, now my questions are,

where this path is exist in the project? how to resolve this error?

Note:

  1. I am using following version VS Code.

Microsoft Visual Studio Community 2019 Version 16.9.1 VisualStudio.16.Release/16.9.1+31105.61 Microsoft .NET Framework Version 4.7.03062

  1. File name *_out in error is changed for each time build.

Thanks,

Pugal.

Prorogue answered 11/3, 2021 at 8:42 Comment(4)
I'd say this is impossible to answer without some sample code of your script task! Especially of the Main() method. Anyways, you wrote that the _out varies after each build - what are you passing as path to your statement? Is it a string you build somewhere else? As you mentioned, this points to a file not being found (or which is not accessible for the current user) - so maybe the path is simply faulty!?Dichogamy
For SSIS Script tasks, especially debugging a lot of times I will write it as a console app (much easier to debug, step through code, and just faster. There is some work to convert it to SSIS script task (sometimes more than others depending on code) but the more complex code or finding issues, in console app much easier and errors are much more understandable.Ringent
Okay I will upload samples. But my main question, what is meant by line 0?Prorogue
@Brad, I am beginner to SSIS and newbee to Script Task.. But Ok will try that using team's help.Prorogue
S
8

Update: There is now fixed in Visual Studio 2019, But the fix is to install the latest version of Visual Studio for Applications.

https://marketplace.visualstudio.com/items?itemName=SSIS.SqlServerIntegrationServicesProjects

There is a regression in VS 2019 16.9 that will cause script task/component not work properly when editing script. VSTA team has released a new version to work around this issue. Please install latest version 3.12.1 to fix the issue, or you can keep on version 3.12 and manually download and install the latest version of VSTA 2019 here.

Old: As per below, this is broken in Visual Studio 2019 16.9

https://marketplace.visualstudio.com/items?itemName=SSIS.SqlServerIntegrationServicesProjects

There is a regression in VS 2019 16.9 that will cause script task/component not work properly when editing script. Please do NOT upgrade to 16.9 currently. If you have already upgraded to 16.9, please rollback to 16.8 or earlier version if you are using script task/component.

So, try with the latest available 16.8.x version. https://learn.microsoft.com/en-us/visualstudio/releases/2019/history#installing-an-earlier-release

You could also vote for this item

https://developercommunity2.visualstudio.com/t/SSIS-script-task-do-not-build/1354064

SSIS script task do not build

enter image description here

Silas answered 13/3, 2021 at 17:17 Comment(3)
Thanks @Subbu, will downgrade to 16.8.x.Prorogue
Sorry for late response. Script task worked fine on version 15.9.34Prorogue
Upgrading VS v16.10 also fixes the issue now.Laris
E
2

I also face with this problem. Downgrade visual studio to 16.8.2 help solve this problem!

Eardrum answered 13/3, 2021 at 7:17 Comment(3)
#66511306Eardrum
Ohh. Thanks for the suggestion. I team met already try this on version 15.9.34 no luck for us.Prorogue
Worked fine on version 15.9.34.Prorogue
C
2

try to install this version of ssis

https://marketplace.visualstudio.com/items?itemName=SSIS.SqlServerIntegrationServicesProjects

Chalcis answered 19/3, 2021 at 12:53 Comment(0)
A
2

A workaround was posted on the VS marketplace:

  1. Click “Edit Script” to open the project in VS
  2. Right click on the project in solution explorer, and click “Open Folder in File Explorer”
  3. In the file explorer, open the csproj or vbproj file with any text editor
  4. Find the two element, change the value to .\bin\Debug\ and .\bin\Release\ separately, or you can simply remove them
  5. Save the csproj or vbproj and reload the project
  6. Now you can try to rebuild the project in VS

The instructions aren't super clear but I found that simply commenting out the OutputPath nodes in the two configuration PropertyGroups did the trick.

For example:

  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <!-- <OutputPath>.\bin\Debug\</OutputPath> -->
    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <DebugSymbols>false</DebugSymbols>
    <Optimize>true</Optimize>
    <!-- <OutputPath>.\bin\Release\</OutputPath> -->
    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
    <DefineConstants>TRACE</DefineConstants>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
  </PropertyGroup>
Andiron answered 14/5, 2021 at 14:41 Comment(1)
In my project, the values were already set to `.\bin\Debug` etc. Removing/commenting them is the key, it seems. VS will then prompt you to reload the project. This is the right solution if you don't have control over your VS2019 version.Laris

© 2022 - 2025 — McMap. All rights reserved.