命名空间“Microsoft.SqlServer”中不存在类型或命名空间名称“Dts”..............但包含引用 [英] The type or namespace name 'Dts' does not exist in the namespace 'Microsoft.SqlServer'..............but the reference is included

查看:200
本文介绍了命名空间“Microsoft.SqlServer”中不存在类型或命名空间名称“Dts”..............但包含引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我们目前正准备从SSIS升级到2017年,但我们的脚本任务出现问题。

Hi, We're currently preparing to upgrade from SSIS 2008 to 2017, but are having problems with our Script Tasks.

我们发现,当使用向导进行升级或使用BIML生成软件包时,我们的脚本任务拒绝在项目的TargetServerVersion为SQL Server 2017时进行编译。我们被赋予了多个"类型或命名空间
名称'Dts'在名称空间'Microsoft.SqlServer'中不存在(你是否缺少程序集引用?)"错误

We have found that when upgrading either using the wizard, or generating the packages using BIML our Script Tasks refuse to compile when the TargetServerVersion of the Project is SQL Server 2017. We are being given multiple "The type or namespace name 'Dts' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?)" errors

我们已经更换了

[ 系统 。<跨度> <跨度>外接程序 <跨度> <跨度>外接程序 <跨度>( <跨度>" ScriptMain"
版本 = " 1.0"
发​​布商 = ""
描述 = "" )]

[System.AddIn.AddIn("ScriptMain", Version = "1.0", Publisher = "", Description = "")]

with

[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]

[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]

但仍然没有运气。

如果我们以Sql Server 2016为目标而不是一切都运行良好

If we target Sql Server 2016 instead everything works perfectly

我们发现如果我们手动编辑DTSX文件中的代码如下,脚本将编译,但显然这不是理想的

We have found that if we manually edit the code in the DTSX file as below, the script will compile, but obviously this isn't ideal

首先,我们需要在CDATA部分内找到相关的< ProjectItem>

First, we need to identify the relevant <ProjectItem>

< ProjectItem>我们需要识别< PropertyGroup>其中包含< AssemblyName>。

Inside the CDATA section for this <ProjectItem> we need to identify the <PropertyGroup> which contains the <AssemblyName>.

在此< PropertyGroup>中,我们添加< TargetFrameworkVersion> v4.5< / TargetFrameworkVersion> ;,然后 脚本任务将按预期编译 

In this <PropertyGroup>, we add <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>, then the Script Task will compile as expected 

推荐答案

从2012年和2012年升级时,我们现在看到类似的问题2016年,大概这是一个2017年的问题而不是2008年的问题

We have now seen similar issues when upgrading from both 2012 & 2016, so presumably this is a 2017 issue and not a 2008 one

此外,这是一个爆料的借口。任何人都可以帮忙??

Also, an excuse for a bump. Can anyone help??


这篇关于命名空间“Microsoft.SqlServer”中不存在类型或命名空间名称“Dts”..............但包含引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆