Skip to content

DllExportOurILAsm causes project to always appear dirty and require build #206

Closed
@nitz

Description

@nitz

Steps to reproduce:

  • Download attached solution, extract, open.
  • Issue build solution command to get fresh builds of all projects.
  • Issue build solution command again, observe behavior.
  • DllExport -version: v1.7.4.29858+c1cc52f
  • Used Visual Studio / MSBuild: MSVS 17.1.0 / MSBuild 15.9.21+g9802d43bc3

Information from Data tab for LibFoo:

Installed: True; 1.7.4+c1cc52f; invoked: 1.7.4
Project type: CsSdk
Storage: ProjectFiles
Compiler.Platform: Auto
Compiler.ordinalsBase: 1
Compiler.rSysObj: False
Compiler.ourILAsm: True
Compiler.customILAsm: 
Compiler.genExpLib: False
Compiler.peCheck: PeIl
Compiler.patches: None
PreProc.Type: None
PreProc.Cmd: 
PostProc.Type: None
PostProc.ProcEnv: $(SolutionPath);$(MSBuildThisFileFullPath)
PostProc.Cmd: 
SignAssembly: 
Identifier: B2B68504-BE59-4B4A-8CEA-9C3E3A6C51F6
Instance: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe
Project path: C:\Users\cmd\source\repos\AlwaysDirtyIssue\LibFoo\LibFoo.csproj
Action: Configure
PlatformTarget: x64
TargetFramework: netstandard2.0
TargetFrameworks: 
TargetFrameworkVersion: 
RootNamespace: 
AssemblyName: 
MgrArgs: 
MetaLib: tools\raw\lib\net20\DllExport.dll
MetaCor: tools\raw\lib\netstd\DllExport.dll
Proxy: 
StoragePath: .net.dllexport.targets
ddNS: LibFoo
ddNS max buffer: 500
UseCecil: True
intermediateFiles: False
timeout: 30000
Options: None
RootPath: C:\Users\cmd\source\repos\AlwaysDirtyIssue\
PkgPath: C:\Users\cmd\source\repos\AlwaysDirtyIssue\packages\\DllExport.1.7.4\
SlnFile: 
SlnDir: C:\Users\cmd\source\repos\AlwaysDirtyIssue\
DxpTarget: tools\net.r_eg.DllExport.targets
MsgGuiLevel: -1
LockIfError: 

Information from Data tab for LibBar:

Installed: True; 1.7.4+c1cc52f; invoked: 1.7.4
Project type: CsSdk
Storage: ProjectFiles
Compiler.Platform: Auto
Compiler.ordinalsBase: 1
Compiler.rSysObj: False
Compiler.ourILAsm: False
Compiler.customILAsm: 
Compiler.genExpLib: False
Compiler.peCheck: PeIl
Compiler.patches: None
PreProc.Type: None
PreProc.Cmd: 
PostProc.Type: None
PostProc.ProcEnv: $(SolutionPath);$(MSBuildThisFileFullPath)
PostProc.Cmd: 
SignAssembly: 
Identifier: D0933B3C-5336-4CFD-B255-303678C9FCE1
Instance: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\MSBuild.exe
Project path: C:\Users\cmd\source\repos\AlwaysDirtyIssue\LibBar\LibBar.csproj
Action: Configure
PlatformTarget: 
TargetFramework: netstandard2.0
TargetFrameworks: 
TargetFrameworkVersion: 
RootNamespace: 
AssemblyName: 
MgrArgs: 
MetaLib: tools\raw\lib\net20\DllExport.dll
MetaCor: tools\raw\lib\netstd\DllExport.dll
Proxy: 
StoragePath: .net.dllexport.targets
ddNS: LibBar
ddNS max buffer: 500
UseCecil: True
intermediateFiles: False
timeout: 30000
Options: None
RootPath: C:\Users\cmd\source\repos\AlwaysDirtyIssue\
PkgPath: C:\Users\cmd\source\repos\AlwaysDirtyIssue\packages\\DllExport.1.7.4\
SlnFile: 
SlnDir: C:\Users\cmd\source\repos\AlwaysDirtyIssue\
DxpTarget: tools\net.r_eg.DllExport.targets
MsgGuiLevel: -1
LockIfError: 

Project Sample

AlwaysDirtyIssue.zip - Reproduction solution w/3 projects:

  • LibMain: A class library that references the other two libraries. (To show that dirty rebuilds causes cascades.)
  • LibFoo: A class library with DllExports using "ourILAsm".
  • LibBar: A class library with DllExports not using "ourILAsm".

Details

The only difference between LibFoo and LibBar should be the setting of DllExportOurILAsm. When issuing "build solution", LibBar behaves as expected, only building & running build events when changes are made. By comparison, LibFoo invokes a portion of the build process (including post build events, DllExport, etc.) every time.

Comparing the output from msbuild between the two projects, LibFoo's output has only a single line of output that LibBar's doesn't:

Copying file from "<sln dir>\LibFoo\obj\x64\Debug\netstandard2.0\LibFoo.pdb" to "<sln dir>\AlwaysDirtyIssue\LibFoo\bin\x64\Debug\netstandard2.0\LibFoo.pdb".

My guess is that, because DllExport deletes the PDB when using "Our IL Asm" since it isn't valid, msbuild thinks the project needs to build because the expected output file is missing.

If one day "Our IL Asm" ever does re-gain the feature of being able to produce PDBs, this issue would be solved. In the meantime, perhaps there's someway to indicate to msbuild that it shouldn't expect to find the PDB?

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions