gkngkc / UnityStandaloneFileBrowser

A native file browser for unity standalone platforms
MIT License
2.07k stars 324 forks source link

Missing Reference System.Windows.Forms #25

Closed NoxMortem closed 6 years ago

NoxMortem commented 6 years ago

grafik For some reason this reference goes missing all the time. I add it again, everything seems to work and shortly after it is gone.

This looks more like some sort of Unity error or related to my IDE but I was still hoping for any help here as I have encountered it only with USFB so far :)

gkngkc commented 6 years ago

Thank you for letting me know,

This error usually happens when /Plugins/System.Windows.Forms.dll's import settings are not checked for windows. It should look like this.

But you're saying it goes missing after some time and i heard other people run into this issue. I'm not exactly sure what causing this. Platform switching? Some unity project bug? Or maybe unity get confused when you add a dll from mono to the project.

I'm afraid i can't offer much help but if you find a case when this reference goes, please let me know.

NoxMortem commented 6 years ago

Sadly the import settings are checked. It goes missing after a few minutes. It is super weird. No platform switching, simply tabbing in and out to unity/rider. I could swear this only happens since 2017.3 but my memory might let me down on this one. grafik

Anyway: Thanks for the plugin! I really like it!

NoxMortem commented 6 years ago

@gkngkc Just founds this warning, which likely is related to this? grafik

Is the standalone file browser not supported on standalonewin64?

gkngkc commented 6 years ago

No it's supported. Here is the cloud build log for standalonewindows64 / Unity 2017.3.0f3

I never see this warning before, what is your unity version?

NoxMortem commented 6 years ago

I have never seen this warning before as well :). It is Unity 2017.3.0f3

@gkngkc btw your cloud build log shows the same warning: [1298] [Unity] System.Windows.Forms.dll assembly is referenced by user code, but is not supported on StandaloneWindows64 platform. Various failures might follow.

XPav commented 6 years ago

I believe this actually showed up with a recent Visual Studio update. I can't actually debug when this is happening, as the build fails. Previously with 15.5.2, if I remove the Reference and re-add it, it then builds.

Interesting notes: when add the reference, in properties, it lists the path as "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.6\System.Windows.Forms.dll", rather than the local dll.

And super oddly, the Visual Studio update released this week (15.5.3) makes my workaround of removing/adding the reference not work.

edit: I got it to build by renaming the plugins/System.Windows.Forms.dll to another name, and adding that reference to the project. Haven't tried a full build yet.

NoxMortem commented 6 years ago

@gkngkc , @XPav working as intended according to Unity. see https://feedback.unity3d.com/suggestions/do-not-remove-references-to-non-net-core-dlls-and-let-us-decide-if-we-want-to-use-them

XPav commented 6 years ago

But it doesn't actually remove the reference, it just puts in a... wrong one. And I don't think it's Unity, I think it's Visual Studio. Or maybe VS and Unity together.

thorgeirk11 commented 6 years ago

Please vote on this feature request 🙏 https://feedback.unity3d.com/suggestions/do-not-remove-references-to-non-net-core-dlls-and-let-us-decide-if-we-want-to-use-them

J450NP13 commented 2 years ago

This issue is still happening in version 2020.3.1

I wanted to use this git….but it didn’t have the normal save dialogue that Windows has so I went to System.Windows.Forms….worked it the editor but couldn’t build it.

It does work by using this in the project then referencing Windows forms and using the Windows save file dialogue.