CS2001执行部署到服务器的SSIS包时缺少AssemblyAttributes.cs

时间:2022-03-23 16:35:41

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.

我创建了SSIS包,并使用Integration Services部署向导将其部署到服务器。我通过SQL Server 2012手动转到Integration Services Catalog访问,右键单击并执行我的包。

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

分配:错误:CS2001 - 无法找到源文件'C:\ Windows \ TEMP.NETFramework,Version = v4.0.AssemblyAttributes.cs',CSC,0,0

Assign :Error: Failed to compiled scripts contained in the package. Open the package in SSIS Designer and resolve the compilation errors.

分配:错误:无法编译包中包含的脚本。在SSIS设计器中打开包并解决编译错误。

4 个解决方案

#1


3  

This answer is a more detailed version of UberDoodles answer.

这个答案是UberDoodles答案的更详细版本。

In Windows Explorer.

在Windows资源管理器中

  1. Navigate to C:\Windows\Temp\
  2. 导航到C:\ Windows \ Temp \

  3. Right click the folder and select properties
  4. 右键单击该文件夹,然后选择属性

  5. Go to tab Security, choose Advanced
  6. 转到安全性选项卡,选择高级

  7. On the default tab Permissions, choose Change Permissions
  8. 在默认选项卡“权限”上,选择“更改权限”

  9. For the relevant Permission entry, choose edit.
  10. 对于相关的权限条目,请选择编辑。

  11. By default, I had 'allow' checked for Traverse folder / execute file, Create files / write data and Create folders / append data.
  12. 默认情况下,我检查了Traverse文件夹/执行文件,创建文件/写入数据和创建文件夹/追加数据。

  13. Also check 'allow' for List folder / read data and Take ownership.
  14. 同时选中“允许”列表文件夹/读取数据并取得所有权。

  15. Press OK, the window closes
  16. 按OK,窗口关闭

  17. Press Apply and confirm anything you need.
  18. 按Apply并确认您需要的任何内容。

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

(基于microsoft文件/文件夹权限)。

#2


2  

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.

基本上,运行包的帐户需要具有C:\ Windows \ Temp \文件夹的完全权限,以便它可以创建临时类。

It worked for me :)

它对我有用:)

#3


2  

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.

我今天遇到了同样的问题,就在SQL 2016上。对我来说,它有助于将Visual Studio项目属性中的目标服务器版本从SQL Server 2012更改为SQL Server 2016。

#4


0  

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.

我有同样的问题。我首先使用Eric G.响应并将list和Read权限添加到c:\ windows \ temp。在我完成所有工作后,我回去取消了该许可。然后我从Visual Studio重新部署了我的解决方案,这次使用Martin的解决方案将部署目标指定为SQL Server 2014(我正在使用的环境)。然后我重新开始这个过程,并且删除了List和Read。

I kept it using Martin's solution, as I don't like to have special permissions granted if I don't need them.

我使用Martin的解决方案保留它,因为如果我不需要它,我不希望获得特殊权限。

Good Luck

#1


3  

This answer is a more detailed version of UberDoodles answer.

这个答案是UberDoodles答案的更详细版本。

In Windows Explorer.

在Windows资源管理器中

  1. Navigate to C:\Windows\Temp\
  2. 导航到C:\ Windows \ Temp \

  3. Right click the folder and select properties
  4. 右键单击该文件夹,然后选择属性

  5. Go to tab Security, choose Advanced
  6. 转到安全性选项卡,选择高级

  7. On the default tab Permissions, choose Change Permissions
  8. 在默认选项卡“权限”上,选择“更改权限”

  9. For the relevant Permission entry, choose edit.
  10. 对于相关的权限条目,请选择编辑。

  11. By default, I had 'allow' checked for Traverse folder / execute file, Create files / write data and Create folders / append data.
  12. 默认情况下,我检查了Traverse文件夹/执行文件,创建文件/写入数据和创建文件夹/追加数据。

  13. Also check 'allow' for List folder / read data and Take ownership.
  14. 同时选中“允许”列表文件夹/读取数据并取得所有权。

  15. Press OK, the window closes
  16. 按OK,窗口关闭

  17. Press Apply and confirm anything you need.
  18. 按Apply并确认您需要的任何内容。

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

(基于microsoft文件/文件夹权限)。

#2


2  

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.

基本上,运行包的帐户需要具有C:\ Windows \ Temp \文件夹的完全权限,以便它可以创建临时类。

It worked for me :)

它对我有用:)

#3


2  

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.

我今天遇到了同样的问题,就在SQL 2016上。对我来说,它有助于将Visual Studio项目属性中的目标服务器版本从SQL Server 2012更改为SQL Server 2016。

#4


0  

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.

我有同样的问题。我首先使用Eric G.响应并将list和Read权限添加到c:\ windows \ temp。在我完成所有工作后,我回去取消了该许可。然后我从Visual Studio重新部署了我的解决方案,这次使用Martin的解决方案将部署目标指定为SQL Server 2014(我正在使用的环境)。然后我重新开始这个过程,并且删除了List和Read。

I kept it using Martin's solution, as I don't like to have special permissions granted if I don't need them.

我使用Martin的解决方案保留它,因为如果我不需要它,我不希望获得特殊权限。

Good Luck