无法在第 0 行的 'C:\' 中找到部分路径

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

我在 SSIS package 中遇到 Script Task 的错误。我可以找到类似的问题,但它们与我的情况不同。

构建脚本失败并出现以下错误(错误列表请参考下图):

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

错误列表:

我能理解这个错误File not found in the path。好的。我可以更改路径,但它显示 line: 0。当我点击错误时,我收到以下通知。

留言:

所以,现在我的问题是,

这个路径存在于项目中的什么地方? 如何解决这个错误?

注:

  1. 我正在使用以下版本的 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. 错误的文件名*_out每次构建都会更改。

谢谢,

普加尔。

我也面临这个问题。将visual studio降级到16.8.2有助于解决这个问题!

更新: 现在已在 Visual Studio 2019 中修复,但修复是为应用程序安装最新版本的 Visual Studio。

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.

: 如下所示,这在 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.

因此,尝试使用最新的 16.8.x 版本。 https://docs.microsoft.com/en-us/visualstudio/releases/2019/history#installing-an-earlier-release

您也可以为此项投票

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

SSIS script task do not build

尝试安装此版本的 ssis

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

VS 市场上发布了解决方法:

  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

说明不是很清楚,但我发现只需注释掉两个配置 PropertyGroup 中的 OutputPath 节点就可以了。

例如:

  <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>