Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The project *projectname*.Editor cannot be added to the solution #66

Closed
arvz opened this issue Jan 17, 2018 · 10 comments
Closed

The project *projectname*.Editor cannot be added to the solution #66

arvz opened this issue Jan 17, 2018 · 10 comments

Comments

@arvz
Copy link

@arvz arvz commented Jan 17, 2018

Imported the AssetBundles-Browser-Master folder into my project and got the error message in Visual Studio 2017:

image

The project 'projectnamehere.Editor' cannot be added to the solution because a project with the same project filename already exists in the solution.

This error comes up, if you press OK it comes up a second time. After that, VS2017 takes you to your code and everything appears fine, except autocompleting Unity stuff no longer works in any Editor scripts.

If I delete the folder and restart VS2017 everything is fine again

@alffanclub
Copy link
Contributor

@alffanclub alffanclub commented Jan 17, 2018

@arvz what version of Unity are you using? We added .asmdef files to the project, but I believe there may be some versions of Unity that have issues creating the VS projects when those are present. As a workaround for now, you can probably delete "Editor/com.unity.assetbundlebrowser.Editor.asmdef" and "Tests/Editor/com.unity.assetbundlebrowser.EditorTests.asmdef".
Please let me know which version you're running, and if deleting the asmdef's fixed it.

Thanks for letting us know about this issue,
Bill

@arvz
Copy link
Author

@arvz arvz commented Jan 17, 2018

@alffanclub I'm using Unity 2017.3.0f3, If I delete the 2 .asmdef files, this happens when I open the browser:

image

https://pastebin.com/rJniLSDy

But it's an easy enough fix: Deleting Line 5 of AssetBundleBrowserMain.cs:

[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("com.unity.assetbundlebrowser.EditorTests")]

Makes it work properly now.

But I am noticing something strange. After I deleted that line I opened the browser - which is working now - but then I added the line back, recompiled and tried the browser again, and it's still working. I even tried deleting and re-adding the folder back into the project and the browser still works even without having touched that line. I guess .asmdef files work in mysterious ways I don't quite understand

@alffanclub
Copy link
Contributor

@alffanclub alffanclub commented Jan 18, 2018

Thanks for all the details. Yeah, asmdef files work in mysterious ways that I also don't fully understand :)

I'll test a few different versions of 17.3. If it's isolated to 0f3, we may be ok, but if it's broken for all of 17.3, I may need to diverge the browser development. Hmm.

Well, thanks again. I'm glad you've got a good workaround, and hopefully I can land on a more permanent fix that doesn't cause people too much grief.

@arvz
Copy link
Author

@arvz arvz commented Feb 8, 2018

@alffanclub Just FYI I've figured out what the actual problem was - it was just that I was running a slightly older version of Visual Studio which doesn't support asmdefs. Once I updated Visual Studio to the latest version everything is fine. Confirmed this with someone else in the forums mentioning the same thing

@arvz arvz closed this as completed Feb 8, 2018
@GuismoW
Copy link

@GuismoW GuismoW commented May 26, 2018

Hello, I have approximately the same error when opening a CSharp file from Unity into VS
image

The Unity version is 2018.2 Beta 5
I don't know what to do, IntelliSense doesn't work as it should

@GuismoW
Copy link

@GuismoW GuismoW commented May 28, 2018

HI. I reinstalled completely updated Visual Studio, and it worked

@strebern
Copy link

@strebern strebern commented Jun 6, 2018

Hey ! I had the same issue and updated my Visual Studio Community to the newest version and it worked.

@SyllabusGames
Copy link

@SyllabusGames SyllabusGames commented Jul 20, 2018

I was able to fix this error message on my project by opening ProjectName.sln in notepad and deleting the duplicate entries at the top.

@Akeronz
Copy link

@Akeronz Akeronz commented Aug 8, 2018

Unity 2018.2 had very similar issue right after upgrading from 2018.1

Solved: Updated Visual Studio 2017 community to V.15.7.6 (previously had V.15.3.x). Thanks for the tips guys!

That's why I don't like upgrades.... (aren't those to have fewer bugs, not more??)

@AFIDclan
Copy link

@AFIDclan AFIDclan commented Dec 27, 2018

None of these worked. After updating VS to the latest version I had to delete all the .csproj files and the .sln from the project, then it rebuilt and worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants