Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
出现错误CS0234:类型或命名空间不';执行部分生成mono类库时不存在_Mono - Fatal编程技术网

出现错误CS0234:类型或命名空间不';执行部分生成mono类库时不存在

出现错误CS0234:类型或命名空间不';执行部分生成mono类库时不存在,mono,Mono,我试图在mono类库包中添加一些缺少的类。我的类使用其他组件。我已将该程序集引用放入.csproj文件中,但它没有帮助 为了使用来自其他程序集的类,我应该做什么?在我看来,当我执行“make”时,似乎没有编译.csproj文件 我在Mono项目贡献页()上花了一些时间,但我仍然找不到如何做 这是我的代码: using System; using System.ComponentModel.DataAnnotations; using System.Web.Security; using Syst

我试图在mono类库包中添加一些缺少的类。我的类使用其他组件。我已将该程序集引用放入.csproj文件中,但它没有帮助

为了使用来自其他程序集的类,我应该做什么?在我看来,当我执行“make”时,似乎没有编译.csproj文件

我在Mono项目贡献页()上花了一些时间,但我仍然找不到如何做

这是我的代码:

using System;
using System.ComponentModel.DataAnnotations;
using System.Web.Security;
using System.Linq;
using System.Text.RegularExpressions;

namespace System.Web.Security
{
    [AttributeUsage(
        AttributeTargets.Property | AttributeTargets.Field | 
        AttributeTargets.Parameter, AllowMultiple = false)]
    public class MembershipPasswordAttribute : ValidationAttribute
    {
...
我尝试使用/mono/mcs/class/System.ComponentModel.DataAnnotations下的System.ComponentModel.DataAnnotations。我的类在System.Web汇编(/mono/mcs/class/System.Web/System.Web.Security)下

这是我在.csproj文件中引用的一个部分

  <ItemGroup>
...
    <ProjectReference Include="..\System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_4_5.csproj">
      <Project>{64e625c0-aa4e-44dc-98f4-352d552f2ef8}</Project>
      <Name>System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_4_5</Name>
    </ProjectReference>
  </ItemGroup>

...
{64e625c0-aa4e-44dc-98f4-352d552f2ef8}
System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net\u 4\u 5

提前谢谢你

您不需要.csproj文件。事实上,我正在学习同一个课程(这是一个很大的巧合)

mono不使用.csproj文件。。。。我是说。。。。是的,但不是真的。对于那些喜欢使用IDE(如visual studio/xamarin等)进行开发的用户来说,这些更适合于打开Makefile目录中的/mcs/class/System.Web,并将其添加到第258行
-r:System.ComponentModel.DataAnnotations\
这似乎对我起了作用

现在再次运行make,您将不会再出现编译错误

不要忘记将
System.Web.Security/MembershipPasswordAttribute.cs
添加到同一目录下net_4_5_System.Web.dll.sources的第4行