DTE ProjectItems.AddFromFile() From MemoryStream

47 Views Asked by At

I am working on a POC and have the following scenario:

I am using DTE to write a file. I have a string in memory that contains the file data.

The "AddFromFile" accepts a string representing the location of the file, retrieves it, and adds it to the project.

I can make this work by:

  1. Taking my string in memory and creating a temporary file
  2. Using the AddFromFile method to copy the temporary file

It seems to me it would be more efficient to have the ProjectItem.AddFromFile use the filedata in my string directly (avoiding the temp file), but have not been able to figure out how to get this to work.

Any suggestions on how to do this? Or, alternatively, is there a better solution than DTE?

Thanks

0

There are 0 best solutions below