This forum has been archived. Please start a new discussion on GitHub.

could not compile ice source code in csharp directory!

I'm using vs2010, ice source code V3.7.0,I compiled cpp source code to win32 and x64 well in vs2010.
But the csharp project could not even open to compile. framework4.0
and I tried framework4.6.1,it still can not compile.



  • i've tried to follow the msbuild under commandline , failed too .
    help me please!!!
    and thank you for your kindness help!

  • xdm
    xdm La Coruña, Spain


    You should try with v3.7.1 that is last release, if this fail can you post the complete build output for C# with Visual Studio 2017, without seeing the error we cannot help you.

  • @xdm, I download the branch of ice 3.7 code,I open the csharp project file named "ice.net45.sln" in vs2017,the result picture is below.
    this is the solution explorer view and the chinese word means "Need to migrate"

  • i used vs2017 community version,do I need to install all c# components to compile this sln?
    is there a way to compile the sln using vs2010?
    please give me some advise.@xdm,thanks.

  • xdm
    xdm La Coruña, Spain

    Try installing the Ice Builder for Visual Studio extension in vs 2017

  • I nerver opened the project correctly on 3.7.1 version.
    but at last I edited the csproj file and comment the

    tag text line and

    tag text line.
    Then reload the project and opend well.
    but the build comes out can not find the IceHome,
    I installed nuget .
    the error out comes like :
    This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see The missing file is ........\msbuild\packages\zeroc.icebuilder.msbuild.5.0.4\build\zeroc.icebuilder.msbuild.props. ice D:\ice-3.7\csharp\src\Ice\msbuild\net45\ice.csproj 500

  • senses1
    edited May 2018

    and there is trully no that file either.,thank you for help ! @xdm
    I noted that @pepone add the similar issue to bug.

  • xdm
    xdm La Coruña, Spain

    As the error point out you need to use "NuGet package Restore" and this will download the missing packages, that is unrelated to the bug

    It will be simpler if you follow the README instructions

    msbuild msbuild\ice.proj

    Also you don't need to edit the project files, if you start making modifications to the project files we will not be able to help. Please revert these modifications and rebuild following the documented process if that doesn't work post the build error.


  • thanks a lot, @xdm!!!! the command goes well after i installed .net core V2.0 SDK, but how could I compile for .net framework4.6.1?
    and how could I compile the ice.dll to x86 debug/release version or x64 debug/release version?

  • xdm
    xdm La Coruña, Spain

    .NET Framework binaries should be placed in lib\net45 those are compatible with .NET 4.6.1

    For a release build set the MSBuild configuration property to Release for example

    msbuild msbuild\ice.proj /p:Configuration=Release

    All the binaries are included in our .NET NuGet package

  • senses1
    edited May 2018

    I add reference ice.dll into a winform project,and there is Ice namespace I slice2cs an ice file, added it to the project. the namespace could not be resolved.

  • xdm
    xdm La Coruña, Spain

    There is nothing special to do, you should review our demos and see how they work.

    I also recommend you review Writing an Ice Application with C-Sharp documentation

  • thanks again @xdm!!!!!
    I solved the problem. it is because that the ice.dll is compiled with .net core 2.0 SDK, so I rewrite my demo csharp project in vs2017,and everything is ok.(my original demo csharp project is written under vs2010,^_^)!!