使用OutputType“模块"来实现.在C#/WPF项目中 [英] Using OutputType "module" in C#/WPF project

查看:413
本文介绍了使用OutputType“模块"来实现.在C#/WPF项目中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我遇到了一个问题,根据Google查找相关主题的能力来看,这似乎很少见.

Hi all!

I've faced a problem, which seems to be quite rare according to google's ability to find related topics.

我正在尝试使用< OutputType>模块</OutputType>"将我的WPF项目构建为netmodule.在项目文件中.在构建过程中失败,出现以下错误:

I'm trying to build my WPF project as a netmodule using "<OutputType>module</OutputType>" within the project file. This fails during the build with following error:

1> C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.WinFx.targets(343,9):错误BG1004:此任务不支持目标类型'模块'.
1 当前项目目录为"D:\ work \ WPF \ MyWPFModule \". (TaskId:17)
1> C:\ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ Microsoft.WinFx.targets(343,9):错误BG1003:项目文件包含无效的属性值.
1>执行任务"MarkupCompilePass2". - 失败的. (TaskId:17)
1>完成构建目标"MarkupCompilePass2";在项目"MyWPFModule.csproj"中-失败.:(TargetId:33)

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(343,9): error BG1004: Target Type 'module' is not supported by this task.
1>  Current project directory is 'D:\work\WPF\MyWPFModule\'. (TaskId:17)
1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(343,9): error BG1003: The project file contains a property value that is not valid.
1>Done executing task "MarkupCompilePass2" -- FAILED. (TaskId:17)
1>Done building target "MarkupCompilePass2" in project "MyWPFModule.csproj" -- FAILED.: (TargetId:33)


MarkupCompilePass2的文档说它确实支持模块输出类型,但是源代码讲述了另一个故事:

Documentation of the MarkupCompilePass2 says that it DOES support the module output type, but the source code tells another story: source

好吧...也有人说VS不支持将项目构建为netmodule.但是,这是什么意思?我也尝试使用cli和msbuild来编译项目,但是那里的错误是相同的.我是否需要以某种方式配置自定义制作文件以 使事情起作用?还是可以在WPF项目中完全使用netmodule输出类型?

Ok...it is also said that VS doesn't support building the project as a netmodule. But what does this mean? I have tried to compile the project also using the cli and msbuild, but the error is same there. Do I need somehow configure a custom make file to make things work? Or is it possible at all to use netmodule output type with WPF project?

是否存在有关如何执行此操作的完整示例.我只找到了csc.exe仅用于单个文件的示例,但是我将需要构建还包含XAML文件的整个项目.

Is there any complete examples on how to do this. I have only found examples where csc.exe is used for just a single file or so, but I would need to build the whole project containing also XAML files.

任何帮助都将非常受欢迎!提前谢谢.

Any help would be very welcome! Thanks in advance.


推荐答案

我认为在不支持xaml的地方,这就是您的问题.

I think where it says xaml isn't supported, that's your problem.

.

您为什么要考虑这样做?

Why are you thinking of doing this?

netmodules的想法是您可以将比装配体小的东西链接到装配体中.

The idea of netmodules is you can link something smaller than an assembly into an assembly.

EG 您在c#项目中需要使用f#或vb中的某些类或某些东西.

EG  you have some class or something in f# or vb you need to use in a c# project.

它不是用于编译整个项目的-这就是exe和dll的用途.

It's not intended for compiling entire projects - that's what exe and dll are for.


这篇关于使用OutputType“模块"来实现.在C#/WPF项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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