Search Unity

Difficulty Getting msc.rsp Working

Discussion in 'Windows' started by stonstad, Mar 6, 2019.

  1. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Hello, sorry to dig this up.

    My csc.rsp file works perfectly fine locally, but seems to fail on Cloud Build ;

    [Unity] Assets/Scripts/Editor/Tools/CloudBuildMethods.cs(94,13): error CS0103: The name 'ZipFile' does not exist in the current context


    Are rsp files supported by cloud build ?
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    The .rsp files should work the same on Cloud Build as they do locally. Can you confirm that Cloud Build is using the same Unity version as you are using locally?
     
  3. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Hello,

    Yes the Unity version are exactly the same.

    Edit : Ok nevermind I feel stupid now, our gitignore add a *.rsp rule in it (written years ago). Removing it from gitignore and launching a "clean" build worked
     
    Last edited: Aug 26, 2019
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    It might be worth submitting a bug report then so we can investigate this.
     
  5. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    Hi, what .dll did you reference, I am struggling to get it working. I am getting similar error as in previous replies. `System.IO.Compression.FileSystem.dll' could not be found.` . Unity 2019.2.2f1 . Could you share how you set it up, please?
    upload_2019-9-10_23-55-28.png
    I don't understand this - because unity already has those references. Also, they are referenced in visual studio assemblies. Why isn't it recognisable in code? I am trying to use `ZipFile` but no luck. I may try to copy .dll to project, but that is probably not the best way to do it.
     
  6. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    My `csc.rsp` file looks like this
    -r: System.IO.Compression.ZipFile.dll
    .
    upload_2019-9-11_0-18-29.png
    This is what I get, it is looking for it in the root folder of the project.
    upload_2019-9-11_0-21-53.png
    After that I have copied the `.dll` file to Assets, set the reference in `csc.rsp` - then it tells me that the `.dll` is in binary, not a text format, gives an error.
     
  7. RDeluxe

    RDeluxe

    Joined:
    Sep 29, 2013
    Posts:
    117
    Our Assets/csc.rsp file looks like this :

    Code (CSharp):
    1. -r:System.IO.Compression.dll
    2. -r:System.IO.Compression.FileSystem.dll
    You should not have to copy any DLL. They are simply excluded by default by Unity, the csc file tells unity to include them.
     
    PixelLifetime likes this.
  8. PixelLifetime

    PixelLifetime

    Joined:
    Mar 30, 2017
    Posts:
    90
    Thanks, that worked. For some reason `-r: System.IO.Compression.ZipFile.dll` alone didn't give me the expected results. But with both `-r:System.IO.Compression.dll` it works just fine. I still can't import `using System.IO.Compression.FileSystem;` in code, but I can access `ZipFile` and it says that it's in `System.IO.Compression`. Thank you for the help :)
     
  9. Jeet_9811

    Jeet_9811

    Joined:
    May 6, 2014
    Posts:
    17
    Hi, I am trying to add the System.Web.dll .NET Standard 3.5 libraries through a csc.rsp file. I am using Unity 2019.2.6f1, with IL2CPP/.NET Standard 4.x scripting.
    Screen Shot 2019-11-19 at 12.44.43 AM.png
    I am getting this compile time error (I have also included the System.Web.dll file in the asset/resources folder - Removing the file from asset/resources folder doesn't make any difference):-

    Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
    Copyright (C) Microsoft Corporation. All rights reserved.

    error CS2001: Source file '{\*\expandedcolortbl;;}' could not be found.

    Removing the csc.rsp file removes the compile time error but I am getting the below run time error when running and playing Unity.
    Error: Could not load signature of System.Web.Configuration.WebConfigurationHost:GetTargetFrameworkVersionEnumFromMoniker due to: Could not load file or assembly 'Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. assembly:Microsoft.Build.Utilities.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a type:<unknown type> member:(null) signature:<none>

    Can you please let me know how can I include the System.Web.dll file to my project.
     
  10. sand_lantern

    sand_lantern

    Joined:
    Sep 15, 2017
    Posts:
    210
  11. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    I'm not sure either, unfortunately. That document is a bit old and out of date though.
     
  12. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,965
    @JoshPeterson Is it possible to place these .rsp files other than in Assets folder? Would be great if unity combines all .rsp files from different folders and merge into a single one before compiling. It eases a lot with out polluting the Scripting Defines w.r.t plugin development.
     
  13. HaraldNielsen

    HaraldNielsen

    Unity Technologies

    Joined:
    Jun 8, 2016
    Posts:
    139
    @Voxel-Busters Unity do actually parse the rsp file generate 1 big rsp pr Assembly.
    Depending on the Unity Version you are using, in the `Library/Bee/artifacts` folder see rsp file generated pr. Assembly we compile.
    You can add other rsp's from a rsp using the `@<SomeLocation>\Foo.rsp`, the only thing is that this is not well supported, and are not monitored by our Compilation system, this means that any changes done will not be triggered.
     
    Voxel-Busters likes this.
  14. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,965
    Thanks for the reply and valuable information.
    Unfortunately, If it's not officially supported, It's tough for us to pick that approach as it will be problem for our plugin users as they will be using different unity versions.

    We wanted it because, we don't want to pollute the global scripting defines (in player settings) for the custom defines we want to use in our plugin when a user switches of/on's a specific feature.

    Currently we are doing this. When user deselects a feature and for stripping the related code,
    This way we can exclude that folder completely to get stripped. Also as link.xml isn't considered when stripping levels are <= medium, we found this is the only way to go. If you have any better options, please share.

    Thanks,
    Ayyappa
     
    HaraldNielsen likes this.