简体   繁体   English

F#和MSBuild工具(silverlight)

[英]F# and MSBuild Tool (silverlight)

We are trying to use Static Resources within a 100% F# Silverlight application. 我们正在尝试在100%F#Silverlight应用程序中使用静态资源。 Embeded within the XAML of the referencing control, everything works. 嵌入引用控件的XAML中,一切正常。 But once I pull them out I am a loss. 但是,一旦我将它们拔出,我就会一头雾水。 C# applications set the build action as: MSBuild:MarkupCompilePass1 C#应用程序将生成操作设置为:MSBuild:MarkupCompilePass1

Two questions 两个问题

1) does VS 2010 support this tool yet in f# silverlight projects? 1)VS 2010是否在f#silverlight项目中支持此工具? 2) If not, then is there way to run it from a command line and then link the resource to the project staticaly? 2)如果没有,那么有没有办法从命令行运行它,然后将资源静态链接到项目?

Thx 谢谢

T Ť

Can you set the Build Action manually in VS in the F# project to match the C# Build Action? 能否在F#项目的VS中手动设置Build Action以匹配C#Build Action? I haven't tried it, but seems like it has a decent chance of working maybe. 我没有尝试过,但似乎它可能有很好的工作机会。

More generally, if you make the .fsproj file look like the .csproj file, I expect it will probably work, though it may not be easy to do this from within VS (may need to edit project file manually perhaps). 更一般而言,如果使.fsproj文件看起来像.csproj文件,我希望它可能会起作用,尽管在VS中这样做可能并不容易(也许可能需要手动编辑项目文件)。 I'd be interested to hear the results. 我想听听结果。

There is no support for MSBuild:CompilePass1 or 2, May be we can expect that in the next version. 不支持MSBuild:CompilePass1或2,也许可以在下一个版本中得到支持。 As of now the only way is to embed it as a "Resource" and use Application.LoadComponent to dynamically build the baml. 到目前为止,唯一的方法是将其嵌入为“资源”并使用Application.LoadComponent动态构建baml。 I did some blog posts WRT to WPF, this should work as-is for full fledged F# Silverlight apps too, 我在WRT到WPF上做了一些博客文章,这对于完整的F#Silverlight应用程序也应该照常工作,

http://fadsworld.wordpress.com/2011/04/13/f-in-the-enterprise-i/ http://fadsworld.wordpress.com/2011/04/13/f-in-the-enterprise-i/

http://fadsworld.wordpress.com/2011/04/13/f-in-the-enterprise-ii-2/ http://fadsworld.wordpress.com/2011/04/13/f-in-the-enterprise-ii-2/

If you need any help, do let me know. 如果您需要任何帮助,请告诉我。

-Fahad -法赫德

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM