在 Visual Studio 2015 扩展中更改项目中文件 ProjectItem 的内容? [英] Change the contents of a file ProjectItem within a Project in a Visual Studio 2015 Extension?

查看:55
本文介绍了在 Visual Studio 2015 扩展中更改项目中文件 ProjectItem 的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在给定的 Project 中更改文件/ProjectItem 的内容?我想用一个字符串替换它的所有内容.

How do I change the contents of a file/ProjectItem within a given Project? I would like to replace all of its contents with a string.

推荐答案

这个问题有解决方案吗?

there is have a resolution of this question?

我想通过使用 VSIX 包对 ProjectItem(CS 文件)进行一些更改,这是我现在看到的唯一一种方法 - 它通过 FullPath 读取此文件,进行更改,然后保存更改.我知道在 ProjectItem 中有 FileCodeModel 属性,但它为空.

I want to make some changes in ProjectItem (CS file) by using VSIX package, and an only single way to do this that I see right now - it's read this file by FullPath, make changes, and then save changes. I know that in ProjectItem have FileCodeModel property, but it is null.

这篇关于在 Visual Studio 2015 扩展中更改项目中文件 ProjectItem 的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆