0

我有数据层、业务层和设计层,其中我的 .edmx 文件放置在数据层中。现在我想为我的 .edmx 文件生成视图以提高性能。我尝试了以下过程:->将 .edmx 文件的元数据工件处理属性设置为“复制到输出目录”,然后在我的数据层的构建事件中输入以下代码:

"%windir%\Microsoft.NET\Framework\v4.0.30319\EdmGen.exe" /nologo /language:CSharp 

/mode:ViewGeneration "/inssdl:$(TargetDir)NeoSoftDataEntity.ssdl" "/incsdl:$(TargetDir)NeoSoftDataEntity.csdl" "/inmsl:$(TargetDir)NeoSoftDataEntity.msl" "/outviews:$(ProjectDir)NeoSoftDataEntity. Views.cs”,但在构建解决方案时。我收到以下错误: *错误 2 命令 ""%windir%\Microsoft.NET\Framework\v4.0.30319\EdmGen.exe" /nologo /language:CSharp /mode:ViewGeneration "/inssdl:D:\NeoSoftWinApp\ NeoSoftWinApp\bin\Debug\NeoSoftDataEntity.ssdl" "/incsdl:D:\NeoSoftWinApp\NeoSoftWinApp\bin\Debug\NeoSoftDataEntity.csdl" "/inmsl:D:\NeoSoftWinApp\NeoSoftWinApp\bin\Debug\NeoSoftDataEntity.msl" "/ outviews:D:\NeoSoftWinApp\NeoSoftWinApp\NeoSoftDataEntity.Views.cs"" 以代码 123 退出。

如何解决这个问题?

4

1 回答 1

1

如果您从 MSDN 站点复制/粘贴,则需要删除命令中的回车符。

"%windir%\Microsoft.NET\Framework\v4.0.30319\EdmGen.exe" /nologo /language:CSharp /mode:ViewGeneration "/inssdl:$(TargetDir)MyModel.ssdl" "/incsdl:$(TargetDir)MyModel.csdl" "/inmsl:$(TargetDir)MyModel.msl" "/outviews:$(ProjectDir)MyModel.Views.cs"
于 2013-02-28T20:09:31.560 回答