CS2001 Missing AssemblyAttributes.cs when executing SSIS package deployed to the server

大城市里の小女人 提交于 2019-12-01 16:59:37

This answer is a more detailed version of UberDoodles answer.

In Windows Explorer.

  1. Navigate to C:\Windows\Temp\
  2. Right click the folder and select properties
  3. Go to tab Security, choose Advanced
  4. On the default tab Permissions, choose Change Permissions
  5. For the relevant Permission entry, choose edit.
  6. By default, I had 'allow' checked for Traverse folder / execute file, Create files / write data and Create folders / append data.
  7. Also check 'allow' for List folder / read data and Take ownership.
  8. Press OK, the window closes
  9. Press Apply and confirm anything you need.

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

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.

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.

It worked for me :)

SPO100

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.

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

Good Luck

[Visual Studio 2017 15.9.16]

I just restarted Visual Studio as Administrator and the issue disappeared, which confirms the permissions idea of the answers above but spared me all work.

It's not a quirk though, as per this question and its answer you need that kind of permission for several tasks, like profiling and debugging under certain conditions.

For the sake of completeness, this blog says you might incur in some security contraindication if run VS as administrator when opening third-party solutions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!