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

dotnet core cannot build in docker container #7844

Closed
geminiyellow opened this issue Mar 3, 2017 · 15 comments
Closed

dotnet core cannot build in docker container #7844

geminiyellow opened this issue Mar 3, 2017 · 15 comments

Comments

@geminiyellow
Copy link

Steps to reproduce

i try to use https://github.com/aspnet/aspnet-docker as my develop environment.
but when i run dotnet build it will raise error

CSC : error CS0041: Unexpected error writing debug information -- 'Windows PDB writer is not available -- could not find Microsoft.DiaSymReader.Native.amd64.dll' [/home/server/server.csproj]

Expected behavior

Actual behavior

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.0-rc4-004771)

Product Information:
 Version:            1.0.0-rc4-004771
 Commit SHA-1 hash:  4228198f0e

Runtime Environment:
 OS Name:     debian
 OS Version:  8
 OS Platform: Linux
 RID:         debian.8-x64
 Base Path:   /usr/share/dotnet/sdk/1.0.0-rc4-004771
@TheRealPiotrP
Copy link
Contributor

curious. CLI builds themselves occur in Docker, so there is likely something else going on here. @tmat, any ideas?

@tmat
Copy link
Member

tmat commented Mar 3, 2017

What is the value of /debug command line argument passed to csc.exe? And version of csc.exe?

@geminiyellow
Copy link
Author

@tmat in . csproj ?

@tmat
Copy link
Member

tmat commented Mar 3, 2017

If you run dotnet msbuild yourproject.csproj /v:diag > build.log and find csc.exe in that log there should be /debug command line argument.

@geminiyellow
Copy link
Author

@tmat thank you ,should i post the log ? it is very long.

@tmat
Copy link
Member

tmat commented Mar 3, 2017

You can just search for a line that contains csc.exe and post the line.

@tmat
Copy link
Member

tmat commented Mar 3, 2017

Or all of such lines if there are multiple

@geminiyellow
Copy link
Author

yep, i searched it, but no one in here, so i ask should i post all.

and all look like CSC is here:

CscToolExe = /usr/share/dotnet/sdk/1.0.0-rc4-004771/Roslyn/RunCsc.sh
                   Using "Csc" task from assembly "/usr/share/dotnet/sdk/1.0.0-rc4-004771/Roslyn/Microsoft.Build.Tasks.CodeAnalysis.dll".
                   Task "Csc" (TaskId:26)
                     Task Parameter:AllowUnsafeBlocks=False (TaskId:26)
                     Task Parameter:CheckForOverflowUnderflow=False (TaskId:26)
                     Task Parameter:DefineConstants=TRACE;DEBUG;NETCOREAPP1_1 (TaskId:26)
                     Task Parameter:DisabledWarnings=1701;1702;1705 (TaskId:26)
                     Task Parameter:EmitDebugInformation=True (TaskId:26)
                     Task Parameter:ErrorReport=prompt (TaskId:26)
                     Task Parameter:FileAlignment=512 (TaskId:26)
                     Task Parameter:NoConfig=True (TaskId:26)
                     Task Parameter:NoLogo=True (TaskId:26)
                     Task Parameter:NoStandardLib=True (TaskId:26)
                     Task Parameter:Optimize=False (TaskId:26)
                     Task Parameter:Deterministic=True (TaskId:26)
                     Task Parameter:OutputAssembly=obj/Debug/netcoreapp1.1/server.dll (TaskId:26)
                     Task Parameter:Prefer32Bit=False (TaskId:26)
                     Task Parameter:
                         Sources=
                             Controllers/GroceriesController.cs
                             Controllers/HomeController.cs
                             Controllers/ValuesController.cs
                             Models/ApplicationDbContext.cs
                             Models/Comments/Comment.cs
                             Models/DatabaseInitializer.cs
                             Models/Migrations/20170215101413_Initial.cs
                             Models/Migrations/20170215101413_Initial.Designer.cs
                             Models/Migrations/ApplicationDbContextModelSnapshot.cs
                             Models/Shops/Shop.cs
                             Models/Users/ApplicationUser.cs
                             Program.cs
                             Startup.cs
                             ViewModels/Shops/ShopViewModel.cs
                             /tmp/.NETCoreApp,Version=v1.1.AssemblyAttributes.cs
                             obj/Debug/netcoreapp1.1/server.AssemblyInfo.cs (TaskId:26)
                     Task Parameter:TargetType=Exe (TaskId:26)
                     Task Parameter:ToolExe=/usr/share/dotnet/sdk/1.0.0-rc4-004771/Roslyn/RunCsc.sh (TaskId:26)
                     Task Parameter:TreatWarningsAsErrors=False (TaskId:26)
                     Task Parameter:UseHostCompilerIfAvailable=True (TaskId:26)
                     Task Parameter:UseSharedCompilation=True (TaskId:26)
                     Task Parameter:Utf8Output=True (TaskId:26)
                     Task Parameter:WarningLevel=4 (TaskId:26)
                     /usr/share/dotnet/sdk/1.0.0-rc4-004771/Roslyn/RunCsc.sh
                     Output Item(s): CscCommandLineArgs= (TaskId:26)
                   Done executing task "Csc" -- FAILED. (TaskId:26)
      817 ms  Csc                                        1 calls

@geminiyellow
Copy link
Author

@tmat is it useful ? or need more ?

@tmat
Copy link
Member

tmat commented Mar 3, 2017

Looks like DebugType parameter is missing for some reason.

@geminiyellow
Copy link
Author

opps, so what is the right parameter ? and how to add it?

@tmat
Copy link
Member

tmat commented Mar 3, 2017

Could you share your project and/or the build log?

@geminiyellow
Copy link
Author

hmm... i think i found the point.

because i try to open it with ide, i forgot what ide, vs for mac or rider,

DebugType parameter is missing for some reason

  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <DefineConstants>$(DefineConstants);RELEASE</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugType></DebugType>
  </PropertyGroup>
  <Target Name="PostpublishScript" AfterTargets="Publish" Condition=" '$(IsCrossTargetingBuild)' != 'true' " />

@tmat
Copy link
Member

tmat commented Mar 6, 2017

That would do it.

@geminiyellow
Copy link
Author

thank you @tmat

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
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

3 participants