Compilation with Power Tools for OpenXML: "OutputTypeAttribute" not found

I use OpenXMLSDK for some DOCX manipulations. I am trying to compile the source of OpenXML Power Tools for reference. I read that I needed to install MS Power Shell to compile (to use cmdlets), so I downloaded it from here . The first option is Windows Management Framework 3.0 CTP1. I'm still having problems with the OutpuTypeAttribute class. It is not available in my code. MSDN talks about this in the System.Management.Automation namespace that I use. I still get this error message for any references to this class:

"The type or namespace name 'OutputTypeAttribute' could not be found (are you missing the using directive or assembly references?).

So does anyone know what is going on here?

By the way, I'm on Windows 7 and use VS 2010.

+6
source share
2 answers

For some reason, C: \ Program Files \ Reference Assemblies \ Microsoft \ WindowsPowerShell \ v1.0 \ System.Management.Automation.dll was an old version and was never updated.

I did the following: In powershell, I ran this command:

Copy ([OutputType].Assembly.Location) ~/Desktop 

Then I moved the dll file that was copied to the desktop to the Reference Assemblies directory shown above. This new file is approximately 3 MB larger than the old one. I also had to convert my project to .NET 4 because this new DLL required it.

+4
source

I don't know if it can help, but System.Management.Automation can be referenced from two places:

For 64 bits:

 C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0 

For 32 bits:

 C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0 

I remember that I use one similar error, using one instead of another.

+2
source

Source: https://habr.com/ru/post/906165/


All Articles