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

Updating to 1.4.0 from 1.3.0 fails with with Unity 2020.1.17 #12

Closed
KuraiAndras opened this issue Jan 6, 2021 · 6 comments
Closed

Updating to 1.4.0 from 1.3.0 fails with with Unity 2020.1.17 #12

KuraiAndras opened this issue Jan 6, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@KuraiAndras
Copy link

Describe the bug
Updated my project from 1.3.0 to 1.4.0 with Unity 2020.1.17 and not all of my sources are compiled

To Reproduce
Can't really

Expected behavior
All sources compile

Screenshots
image

Environment (please complete the following information):

  • Version 1.4.0
  • Platform: Editor/Windows
  • Unity version: 2020.1.17
  • Build options: .Net 4.x

Additional context
The problem might come from the fact that we are using external .cs files added as unity packages. We have several projects included like:

[package.json]
"bimvisualizer.shared": "file:../../BimVisualizer.Shared",

These point to folders with .net standard 2.0 projects (which are using C#9.0) (also the bin and obj folders are renamed to .bin and .obj so unity will not try to use the dlls inside them). The errors seem to only come from one project where c# 9 and 8 are used, and not from the unity project.

Should I include another folder for assemblies in the settings?

@KuraiAndras KuraiAndras added the bug Something isn't working label Jan 6, 2021
@mob-sakai
Copy link
Owner

@KuraiAndras
The asmdef files under the Packages directory are excluded by default.
(Prefix ! means "should be excluded.")

image


Solution 1:

  • Project Settings > C# Compiler > Compiler > Included Assemblies
  • Set Packages/your_package_name/ instead of !Packages/
    • e.g. Packages/com.bim.visualizer.shared/

Solution 2:

  • Select the asmdef file under the Packages directory
  • Turn on Enable C# Compiler Settings in inspector
  • Choose the compiler package and the language version
  • Click Apply

@KuraiAndras
Copy link
Author

KuraiAndras commented Jan 6, 2021

To be precise, we have multiple projects, and they are not located in the packages folder. The structure is like:

bimvisualizer.shared
    |   bimvisualizer.shared.asmdef
    |   package.json
bimvisualizer.application
    |   bimvisualizer.application.asmdef
    |   package.json
*etc
bimvisualizer.unity
    |   Packages
        | manifest.json
        | package-lock.json
    |   Assets
        |   multiple asmdefs, assets, etc

In this context what does the Packages folder refer to? [UnityProject]/Packages or [UnityProject]/Library/PackageCache or just whatever folder the UPM resolves when reading the mainfest?

Also why is the Packages folder excluded by default?

@mob-sakai
Copy link
Owner

@KuraiAndras

Check name field in bimvisualizer.shared/package.json and bimvisualizer.application/package.json.

For example:

[bimvisualizer.shared/package.json]
{
  "name": "com.bim.visualizer.shared",
  "version": "1.0.0",
  ...
}

and

[bimvisualizer.application/package.json]
{
  "name": "com.bim.visualizer.application",
  "version": "1.0.0",
  ...
}
  • Remove !Packages/
  • Add Packages/com.bim.visualizer.shared
  • Add Packages/com.bim.visualizer.application

Also why is the Packages folder excluded by default?

This is to prevent unintended compiler changes and to minimize the impact of compiler changes.
Packages and store assets should (essentially) be compiled with the default compiler.

@KuraiAndras
Copy link
Author

I'll try this and get back to you soon

@KuraiAndras
Copy link
Author

Yupp, the project wors, after including the assemblies like : Packages/package.name.etc .
You can close this now if you want.

Also could you provide some documentation on this in the readme?

@mob-sakai
Copy link
Owner

👍

Also could you provide some documentation on this in the readme?

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants