unity3D 初学项目报错IOException: Win32 IO returned 234我的解决方案

最近学习unity3d,unity提供了很多教学例子,并且有配套的教学指示。之前我有下载学习这个页面中的例子工程学习,一切正常。

因为之前默认是vs2010打开C#脚本,我电脑中还装有VS2019,所以我卸载了vs2010,在这之后项目还是正常运行。可是有一次我翻看文件目录发现VS2010还残留了一个5G的文件夹,我想都没想就删除了,之后我再通过以下这个页面打开完整项目就会报错如下:

 错误的详细信息:

IOException: Win32 IO returned 234. Path: C:\Users\77433\AppData\Local\Temp\7dcd9938d852126429ab58bbfbc2d240\Library\PackageCache\com.unity.learn.iet-framework@0.2.1-preview.1\Framework\Interactive Tutorials\Editor\Internal Proxy\UnityEditor.InteractiveTutorialsFramework.asmdef
System.IO.FileStream.get_Length () (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
(wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean checkHost) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
System.IO.StreamReader..ctor (System.String path, System.Boolean detectEncodingFromByteOrderMarks) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
System.IO.StreamReader..ctor (System.String path) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
(wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(string)
System.IO.File.ReadAllText (System.String path) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.LoadCustomScriptAssemblyFromJson (System.String path) (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:469)
UnityEditor.Scripting.ScriptCompilation.EditorCompilation.SetAllCustomScriptAssemblyJsons (System.String[] paths) (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:689)
UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:SetAllCustomScriptAssemblyJsons(String[]) (at D:/unity/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:217)

如果你也遇到了IOexception:234这个错误并且在网上寻求帮助,那你肯定看过这个博客

https://blog.csdn.net/weixin_43384713/article/details/99625805#comments

但是对比两个博客出错的位置,他是在windows kit这个文件夹也就是我们的windows SDK的文件夹出错,但是我却是在用户文件夹appdate里面出错的。所以我尝试更新windows SDK,重装VS2019之后还是没有解决问题。

但是经过我的瞎尝试,我似乎成功的让原来的完整项目不在报错。步骤很简单,如下:

1.用HUB创建新项目:

 2.在unity中的ASSET STORE中搜索你要学习的项目这里以FPS microgame为例,点击下面的下载并且下载完后导入(import)所有文件到这个空项目中

然后它可能会提示你要更新或者安装依赖,点确定就好了。耐心等待项目导入问题到这就解决了,这种方式导入的项目就不会有234那个错误了~

之后再打开这个项目还是需要在unity HUB中的项目列表中点击打开。

分析:具体是什么原因引起的IOE 234错误我还是不知道,我觉得上文提到的那个博客描述的文件太长了应该是正解,可以看到在错误信息中有get_length()这个函数。

可以看到,没有编译错误。

这种方式下载的unity package 是在complete projects templates这个文件夹中

而你直接点击学习栏目中的下载项目则是放在project文件夹中

 

 

结论就是:不要乱删文件!!! 

搞了两天才解决错误  TAT

如果有帮助麻烦点个赞!谢谢啦

  • 7
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值