更改目标.NET Framework for Office 2013 / VSTA 2012 / InfoPath 2007项目 [英] Changing target .NET Framework for Office 2013 / VSTA 2012 / InfoPath 2007 project

查看:91
本文介绍了更改目标.NET Framework for Office 2013 / VSTA 2012 / InfoPath 2007项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我多年来一直在开发InfoPath Web表单,所以我很高兴(最后!)了解新的VSTA我可以编写代码对于我的表单直接在Visual Studio 2012中。

I have been developing InfoPath web forms for a number of years, so I was excited to learn that (finally!) with new VSTA I can write code for my forms directly in Visual Studio 2012.

所以我在Windows 8 x64笔记本电脑上安装了Office 2013,Visual Studio 2012,VSTA for VS 2012(RTM)并尝试了一下。在这个新的开发环境中打开现有的InfoPath 2007项目有点挑战,但是我终于做对了。

So I installed Office 2013, Visual Studio 2012, VSTA for VS 2012 (RTM) on my Windows 8 x64 laptop and gave it a try. Opening an existing InfoPath 2007 project in this new development environment was a bit challenging,  but I finally got it right.

从我观察到的,VSTA现在处理InfoPath表单的方式代码自然是一个hocus-pocus,因为它将代码缓存到某个地方,并在您工作时在缓存中进行所有更改,仅在保存表单时将更改刷新到表单的源文件夹。

From what I observed, the way VSTA now handles InfoPath form code is naturally a hocus-pocus, as it caches the code somewhere and makes all changes in that cache as you work, flushing the changes to the form's source folder only when you save the form.

我面临的挑战是我的大多数InfoPath项目都是针对.NET Framework 3.5的,因为我引用了我需要用来访问企业环境等数据的定制库。以前,我从来没有遇到过更改目标框架的问题InfoPath 2007项目的
,但VSTA 2012没有 - 改变根本不坚持。

The challenge I have is that most of my InfoPath projects target .NET Framework 3.5, as I reference custom-built libraries that I need to use to access data in our corporate environment etc. Previously, I never had an issue changing the target framework for an InfoPath 2007 project, but not with VSTA 2012 - the change simply doesn't stick.

场景:

我打开单击一个表单,单击编辑代码,将目标框架更改为3.5,编译然后在预览中成功运行我的表单。然后我保存并关闭表单。项目文件(.csproj)有    < TargetFrameworkVersion> V3.5< / TargetFrameworkVersion>
条目,如预期。然后我重新打开表单,单击Edit Code,然后我这样做,VSTA默默地将目标框架更改回2.0,所以之后我的项目根本就不编译。哦,如果我尝试预览表单,它会选择以前编译的
版本的程序集(更不用说所做的更改)并且工作得很好。因此,在我对代码进行更改之后,我必须将目标框架更改为3.5,然后我们再次进行....

I open a form, click Edit Code, change target framework to 3.5, compile and then successfully run my form in a preview. Then I save and close the form. The project file (.csproj) has     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> entry, as expected. Then I reopen the form, click Edit Code, and as I do so VSTA silently changes the target framework back to 2.0, so after that my project simply doesn't compile. Oh, and if I try to preview the form, it would pick up a previously compiled version of assembly (never mind the changes made) and work just fine. So, after I've made changes to the code, I have to change target framework to 3.5 and here we go again....

将.csproj文件设为只读'帮忙。有人可以帮忙吗?

Making the .csproj file read-only didn't help. Can somebody help?

谢谢,

Alexey

推荐答案

您好Alexey,

Hi Alexey,

感谢您在MSDN论坛上发帖。

Thank you for posting in the MSDN Forum.

I会让一些更熟悉您问题的专家参与其中。这可能需要一些时间。

I'll involve some experts who are more familiar with your issue. This may take some time.

感谢您的耐心和理解。

祝你好运,

这篇关于更改目标.NET Framework for Office 2013 / VSTA 2012 / InfoPath 2007项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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