u012094400
愈来愈好
2016-05-07 02:30

unity+c#发布问题 web与pc

我用c#作为脚本语言发布unity项目的时候发布pc版本没问题,但是发布web版本是出现报错
错误 35 Type System.IO.FileInfo' does not contain a definition forDelete' and no extension method Delete' of typeSystem.IO.FileInfo' could be found (are you missing a using directive or an assembly reference?) Assets/Scripts/Presenter/DianTuoManager.cs 8592 29 解决方案“UnityVS.DQTD”‎(1 个项目)
然后我仔细对比发现使用两个方法发布主要是#region 程序集 mscorlib.dll, v2.0.0.0存在差异:

web版使用的****

#region 程序集 mscorlib.dll, v2.0.0.0
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v3.5\Profile\Unity Web v3.5\mscorlib.dll
#endregion

using System;
using System.Runtime.InteropServices;
using System.Security;

namespace System.IO
{
[Serializable]
[ComVisible(true)]
[SecurityCritical]
public sealed class FileInfo : FileSystemInfo
{
public FileInfo(string fileName);

    public string DirectoryName { get; }
    public override bool Exists { get; }
    public override string Name { get; }

    public StreamWriter AppendText();
    public StreamWriter CreateText();
    public FileStream Open(FileMode mode, FileAccess access);
    public FileStream Open(FileMode mode, FileAccess access, FileShare share);
    public override string ToString();
}

}
## PC版使用的
#region 程序集 mscorlib.dll, v2.0.0.0
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v3.5\Profile\Unity Subset v3.5\mscorlib.dll
#endregion

using System;
using System.Runtime.InteropServices;

namespace System.IO
{
[Serializable]
[ComVisible(true)]
public sealed class FileInfo : FileSystemInfo
{
public FileInfo(string fileName);

    public DirectoryInfo Directory { get; }
    public string DirectoryName { get; }
    public override bool Exists { get; }
    public bool IsReadOnly { get; set; }
    public long Length { get; }
    public override string Name { get; }

    public StreamWriter AppendText();
    public FileInfo CopyTo(string destFileName);
    public FileInfo CopyTo(string destFileName, bool overwrite);
    public FileStream Create();
    public StreamWriter CreateText();
    [ComVisible(false)]
    public void Decrypt();
    public override void Delete();
    [ComVisible(false)]
    public void Encrypt();
    public void MoveTo(string destFileName);
    public FileStream Open(FileMode mode);
    public FileStream Open(FileMode mode, FileAccess access);
    public FileStream Open(FileMode mode, FileAccess access, FileShare share);
    public FileStream OpenRead();
    public StreamReader OpenText();
    public FileStream OpenWrite();
    [ComVisible(false)]
    public FileInfo Replace(string destinationFileName, string destinationBackupFileName);
    [ComVisible(false)]
    public FileInfo Replace(string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors);
    public override string ToString();
}

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

0条回答