.net - MSBuild 3.5 produces different IL than MSBuild 4 for the same code -


Can not compile a working dll to point to VS'08, though I basically said It was

We have a piece of VB code which is compiled differently depending on which devices are used to compile.

I have tried to compile this code on many different computers using Visual Studio '08, '10, and MSWલ્ડ 3.5 and 4.MsBuild 3.5 (which uses our build server ) And VS'08 always produce a broken DLL, while MSWilled 4 / VS'10 produces a working DLL. I compare the only difference (/ nodstdlib, / sdkpath, / langversion: 9) of the Vbc command line parameters between MSBuild 3.5 and 4 that all Vbc 4s seem to be related to compiling 3.5 compatible dll.

The broken version, if throws an error to the code located inside the statement, then can not be the representative 'tap' for an example method.

There is a snippet of the related code:

  Dim foldedList as folder = FolderManager.Instance.GetFoldersSorted (portalId) Dim list new list (FolderInventoryItem ) Folders.Values ​​in the form of a fileSysItem for each folderItem for every folder (string, folderInfo) CurrentFolder = folderItem (if not list any. (Function (f) f.UniqueId = currentFolder UniqueId) then ....  

Using Reflector to isolate the VB to IBL, the work is included in DLL :

  dim folders mentioned as sorted list (string, folderInfo) = component badge (IFolderManager, FolderManager) .instance.getfolders sorted (portalId) slow source new list ( FolderInventoryItem's) for slow information folderInfo form foldersSorted.Values ​​for each information as dim E $ __ _Closure $ __ 2E $ __ = new _Closure $ __ 2 (E $ __) {_. $ VB $ Local_currentFolder = Information _} If not new.file (FolderInventoryItem) then ((FolderInventoryItem, Boolean) (new address of AddressOf E $ __._Lambda $ __6))  
< P> Using Reflector VB does not collect IL, broken dll include:

short foldersSorted SortedList = ComponentBase (string, folderInfo) (IFolderManager, FolderManager) .Instance. GetFoldersSorted (portalId) the new list as a slow source (FolderInventoryItem's) dim info folderInfo form foldersSorted.Values ​​for each of the information dim E $ __ as _Closure $ __ 2Drive E $ __ 2 _Closure $ __3 E $ __ = new _Closure $ __ 2 (E $ __) {_. $ Local_currentFolder = Info_} as $ VB. Source.Any (of FolderInventoryItem) (New Function (FolderInventoryItem, Boolean) (AddressOf E $ __ 2._Lambda $ __6)) After this If

Scott,

Visual Basic Compiler and MSWld team are looking at the problem you describe But being troubled if it is being repaired, can you possibly reproduce this issue with a small project of a code file? Is this issue present when building with your buildwork workstation or MSBList 3.5 on the Build Server only? Does it affect all Lambodas or only this one? If you have taken this code to a different method or changed it a little bit, would it still be wrongly created?

If you do not feel comfortable sharing any additional information about your project then you can report it as a bug and we can personally follow it.

Regards,

Anthony D. Green | Program Manager | Visual Basic Compiler


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -