locked
Newly added, saved, and built class file modules are not visible to code-behind application .vb code. RRS feed

  • Question

  • User-2124111250 posted

    I have inheirited an old VB web-site application originally done in VS 2005 and migrated to 2008, 2010, and finally to 2015.  It is giving me all kinds a troubles with adding new subroutine and functions to existing class files and accessing them from .aspx.vb code files.  In the application code-behind .vb file, it tells me the routine name is not a member of the class name file when it obviously is.  It is not a spelling error of any kind.  when in the code-behind and looking at the meta data listing of the meta-data contents (using ctrl-F12 peek) of the class instantiation, it shows all the old modules, but none of the newly added modules are visible.

    Additionally, I have been experiencing other issues with VS just hanging, requiring the use of the Task Manager to end the VS task and restart it.  These are accompanyied by CodeDom file locations not found and build warnings in the Microsoft.VisualBasic.Current.Version.targets file of "Could not find ruleset file"..\Combined Ruleset.ruleset"", for each of the seperately compiled class files/modules (Business Layer, Data Layer, etc.).  Additionally, when reviewing the Microsoft.VisualBasic.Current.Version.targets file  in VS, many of the properties are underlined with invalid child element or attribute not declared errors, without being reflected in the application.  I believe this latter may be related to the former issue and possibly is why newly added class module routines are not being instantiated:

      

      Code-Behind:

            Private Sub ASPxGridViewUnscheduledReviews_RowDeleting(ByVal sender As ObjectByVal e As DevExpress.Web.Data.ASPxDataDeletingEventArgsHandles ASPxGridViewUnscheduledReviews.RowDeleting
    		'Dim aspxGridView As ASPxGridView = sender
    		Dim StatusID As Integer
     
    		'delete row from ACRStatus table where AcrStatusID = StatusID
    		Try
    			StatusID = CType(e.Keys("AcrStatusID"), Integer)
    			lblMessage.Text = String.Empty
    			Dim bl As New CYCIS_BL.Reviews
    			bl.UnscheduledReviewDelete(StatusID) <-- ERROR: BC30456 'UnscheduledReviewDelete' is not a member of 'Reviews'
     
    			Response.Redirect("ACR_RemoveUnSchReview.aspx")
     
    		Catch ex As Exception
    			lblMessage.Text = ex.Message
    		End Try
     
    	End Sub

    CYCIS_BL.Reviews Class File Routine:

    Public Shared Sub UnscheduledReviewsDelete(ByVal StatusID As Integer)
    		CYCIS_DL.CustomReviews.UnscheduledReviewDelete(StatusID)
    	End Sub


    Ron K.

    Wednesday, December 21, 2016 10:15 PM

Answers

  • User-2124111250 posted

    Well it seems no one has any answers for me.  But, as I stated in the above, "it is as if there are It is as if there are two different sets of .DLLs for the class libraries", which turned out to be true.  What I failed to notice is that the web-project references were set to pull from the bin file .dll's of the web-project.  It had been like this from before I took it over.  When I changed the reference to point to the bin directory of each individual class-file project, it started working properly and is now recognizing the new methods. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 28, 2016 7:57 PM

All replies

  • User-1838255255 posted

    Hi Ronald Kunce,

    According to your description, I have some suggestion you can try to:

    1. check if add reference to this project.

    2. check if can call the other method of this class.

    3. rebuild your all project.

    If this suggestion can't solve your problem, please describe the process of call method and structure of your project.

    Best Regards,

    Eric Du

    Thursday, December 22, 2016 8:11 AM
  • User-2124111250 posted

    1.  Yes, the web-app project has references to all three of the other class library projects (BL - Business Layer; BO - Business Objects; and DL - Data Layer) even though only the BL layer can call methods in the DL project classes.

    2.  Yes all the other methods in the class can be called just fine from the web-app project.

    3.  All projects have been built, cleaned, and rebuilt over and over again to no effect in resolving the issue.

    If this suggestion can't solve your problem, please describe the process of call method and structure of your project.
    :  Not sure what you are asking for with this.  It is a standard web-site application/solution with four project files under VS 2015 and VB currently using .NET Framework 4.6.2.  The calling method is used to delete extraneous records from a SQL Server 2012 table log of reviews needing to be scheduled where the field StatusID is the table's primary key.  The web-site screens use Developer Express ASPxGridViews to display the table's content where a record is selected for deletion.  I have no issue with that process.   I created BL class file Reviews' subroutine UnscheduledReviewsDelete to call a similar method in the data layer (DL) to execute a stored procedure in the database to do the actual deletion.

    Note: it dawned on me to just try and create a new class library project to which I copied the Reviews class file making all the proper references and it appears to work in recognizing the UnscheduledReviewsDelete method in the web-site project that would not instantiate from the older class library file.  This appears to be the simple solution, however it does not explain why the older library files cannot be added with new modules.  Nor, would it be so simple as the older libraries have hundreds of class files with thousands of methods that would all have to be re-verified if I was migrate all into new library projects.      

    Thursday, December 22, 2016 3:40 PM
  • User-2124111250 posted

    added:  It is as if there are two different sets of .DLLs for the class libraries and the web-site code references are pointed at the old .DLLs which are not replaced when the business layer project is built.  I searched my local solution workspace for all .DLLs and found I have copies of the three supporting class library .DLLs all over the place in my directories, where in particular the web project Bin file's entries date back to November 1st, while I have been making updates and created these same .DLLs in the bin file of the library project directories just yesterday and today.  

    Isn't MSBUILD supposed to synchronize the .DDL's at the various levels when the full solution is rebuilt?  Is there a setting or property that can interfere with this?  If its a Namespace issue, I have not been able to find and need some help in directing me where to look. 

    Thursday, December 22, 2016 8:51 PM
  • User-2124111250 posted

    Well it seems no one has any answers for me.  But, as I stated in the above, "it is as if there are It is as if there are two different sets of .DLLs for the class libraries", which turned out to be true.  What I failed to notice is that the web-project references were set to pull from the bin file .dll's of the web-project.  It had been like this from before I took it over.  When I changed the reference to point to the bin directory of each individual class-file project, it started working properly and is now recognizing the new methods. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 28, 2016 7:57 PM