如何在Visual Studio 2010 vsto clickonce应用程序中将文件标记为数据文件? [英] how do I mark a file as a data file in a visual studio 2010 vsto clickonce application?

查看:286
本文介绍了如何在Visual Studio 2010 vsto clickonce应用程序中将文件标记为数据文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Visual Studio 2010中使用C#4.0制作一个Word 2007加载项。我需要一个Access 2007数据库(.accdb文件),要由clickonce安装程序放置在数据目录中。不幸的是,文件被放到别的地方,所以应用程序在运行时找不到它。我看到各种文章指向使用项目属性的发布选项卡上的应用程序文件对话框将文件标记为数据文件,但我有一些原因没有应用程序文件按钮。

I'm making a Word 2007 add-in with C# 4.0 in Visual Studio 2010. I need an Access 2007 database (a .accdb file) to be placed in the data directory by the clickonce installer. Unfortunately, the file is getting put elsewhere, so the application can't find it at runtime. I've seen various articles refer to using the Application Files dialog on the Publish tab of the project properties to mark the file as a data file, but I have no Application Files button for some reason.

任何想法如何使应用程序文件对话框出现,或以其他方式手动标记我的.accdb文件作为数据文件?

Any idea how to make the Application Files dialog appear, or some other way to manually mark my .accdb file as a data file?

推荐答案

我可以使用Mage工具来完成工作,如下所示:

I was able to get things to work by using the Mage tool as described here:

http://msdn.microsoft.com/en-us/library/6fehc36e.aspx

MageUI的窍门是它的打开文件对话框假定你想打开一个与.exe相关联的清单;一个vsto项目有一个.dll,所以清单不会出现在文件列表默认情况下,这真的让我起来。

The trick with MageUI is it's open file dialog assumes you want to open a manifest associated with a .exe; a vsto project has a .dll, so the manifest doesn't appear in the files list by default, which was really tripping me up.

基本上,这个过程是一个疼痛,因为你必须记住手动做。我不知道是否有一个方法来构建这个部分(也许是一个后构建步骤,但这是一个后发布步骤)。

Basically, this process is a pain because you have to remember to do it manually. I don't know if there's a way to make this part of the build (maybe a post-build step? But this is really a post-publish step).

这篇关于如何在Visual Studio 2010 vsto clickonce应用程序中将文件标记为数据文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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