VsMSBuildTaskFileManagerClass::PutGeneratedFileContents Method (String^, String^)
Puts the contents for the generated file into an in-memory TextBuffer and registers it in the running document table (RDT) with an RDT_ReadLock. This holds the file open in memory until the project is closed (when the project calls IVsMSBuildHostObject::Close).
Assembly: Microsoft.VisualStudio.Shell.Interop.9.0 (in Microsoft.VisualStudio.Shell.Interop.9.0.dll)
public: virtual int PutGeneratedFileContents( String^ wszFilename, String^ wszFileContents )
Parameters
- wszFilename
-
Type:
System::String^
[in] The filename of the file from which to obtain generated contents.
- wszFileContents
-
Type:
System::String^
[out] The generated contents retrieved from the specified file.
Return Value
Type: System::Int32Returns S_OK if the method is successful; otherwise, returns E_FAIL if the document is in the RDT and something else has a lock on it which cannot be removed automatically.
If this is an actual build operation (UICONTEXT_SolutionBuilding is on), then the file contents will also be saved to disk. If this is a design-time-only generation for IntelliSense purposes, then the file contents are only put into memory and the disk is not modified. The in-memory TextBuffer is always marked as clean so the user will not be prompted to save the generated file.