none
Two compilation time errors in a large C# program RRS feed

  • Question

  • I just posted the issue in another thread and got a great answer that solved the problem. So, this thread is a continuation of the previous thread Compilation time error #1

    Now that error disappeared and lo and behold I have only two errors while compiling. I want to remind that my program was written years ago.

    These are the errors:

    Error    CS0234    The type or namespace name 'Synchronization' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

    Error    CS0234    The type or namespace name 'MessageBox' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?)

    From the rapidity my first questions was answered and resolved, I don't expect these questions will wait too long :-)

    Many thanks, - Alex

    Wednesday, May 16, 2018 7:18 PM

Answers

  • I finally resolved all linkage problems and now I attempt to debug it. It does not run well. Too many problems because it is older software.
    • Marked as answer by MyCatAlex Sunday, May 20, 2018 6:06 PM
    Sunday, May 20, 2018 6:06 PM

All replies

  • https://www.youtube.com/watch?v=f90En1GnJYY

    Try it and see if Nuget will  recover the missing packages.

    Wednesday, May 16, 2018 7:41 PM
  • If you already have a Using statement in your code, you need to add a reference to System.Windows.Forms:

    Right click on the project
    click on "add reference"
    in the opened window go to ".net" tab
    look for System.Windows.Forms and press OK (or double click on it)

    Perform same for Microsoft.SqlServer

    Under "system.web -> compilation -> assemblies" node in my web.config, add the following lines:
    <add assembly="Microsoft.Synchronization, Version=2.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
    <add assembly="Microsoft.Synchronization.Data, Version=3.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
    <add assembly="Microsoft.Synchronization.Data.SqlServer, Version=3.1.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>



    Thanks, AT

    Wednesday, May 16, 2018 7:41 PM
  • @AT - I already have System.Windows.Forms in my reference. I have Microsoft.SqlServer.smo and a number of others but not Microsoft.SqlServer. I could not add it either. It is not in the list of references. Will try the first suggestion. - Alex
    Wednesday, May 16, 2018 8:16 PM
  • @DA - It seems I should try to run dotnet restore command but where do I run it? In the visual studio? This site does not say where dotnet restore
    Wednesday, May 16, 2018 8:29 PM
  • @AT - I don't have .NET tab in my list of references.

    • Edited by MyCatAlex Wednesday, May 16, 2018 8:45 PM
    Wednesday, May 16, 2018 8:44 PM
  • @DA - It seems I should try to run dotnet restore command but where do I run it? In the visual studio? This site does not say where dotnet restore

    https://www.youtube.com/watch?v=f90En1GnJYY

    I think the example is pretty clear on how to do it.

    Thursday, May 17, 2018 1:19 AM
  • Well, it is "sort of" clear. I don't know how people can use YouTube since in the example I found at the link you provided the texts are so small as to be undecipherable even with a magnifying glass. Nonetheless I am very grateful for the pointer to you, @DA924x. Still I could catch enough information to attempt to run it. First, I found that NuGet is part of the Visual Studio. The tabs could be found in two places, however, when I right clicked on the project name and found "Manage Nuget packages," and clicked on it the answer was: "No packages found."

    If I go to the Tools and find again "Manage Nuget packages" under that tab I have an option to get  "Package Management Console." It gave me PM> prompt and I tried Restore "Microsoft.Synchronization," (as an example). In fact this reference is on the list of my references but the errors I get demands this:

    CS0234    The type or namespace name 'Synchronization' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
    So, I don't quite know what to do, still. Thanks for your help.


    • Edited by MyCatAlex Thursday, May 17, 2018 9:15 PM
    Thursday, May 17, 2018 9:08 PM
  • PM> install Microsoft.Synchronization Version=2.1.0.0

    https://blog.jennysjottings.co.uk/2014/04/19/installing-a-specific-version-of-a-package-using-nuget-in-visual-studio/

    Try it see if it does it.

    Thursday, May 17, 2018 9:20 PM
  • I use the magnifier Windows provides.

    https://support.microsoft.com/en-us/help/257561/how-to-install-and-use-microsoft-magnifier

    https://support.microsoft.com/en-us/help/11542/windows-use-magnifier

    Thursday, May 17, 2018 9:26 PM
  • I tried the install command and got an error.

    Each package is licensed to you by its owner. NuGet is not responsible for, nor does it grant any licenses to, third-party packages. Some packages may include dependencies which are governed by additional licenses. Follow the package source (feed) URL to determine any dependencies.
    
    Package Manager Console Host Version 4.1.0.2427
    
    Type 'get-help NuGet' to see all available NuGet commands.
    
    PM> restore
    restore : The term 'restore' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling 
    of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + restore
    + ~~~~~~~
        + CategoryInfo          : ObjectNotFound: (restore:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PM> restore "MessageBox"
    restore : The term 'restore' is not recognized as the name of a cmdlet, 
    function, script file, or operable program. Check the spelling of the name, or 
    if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + restore "MessageBox"
    + ~~~~~~~
        + CategoryInfo          : ObjectNotFound: (restore:String) [], CommandNotF 
       oundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PM> restore "Microsoft.Synchronization"
    restore : The term 'restore' is not recognized as the name of a cmdlet, 
    function, script file, or operable program. Check the spelling of the name, or 
    if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + restore "Microsoft.Synchronization"
    + ~~~~~~~
        + CategoryInfo          : ObjectNotFound: (restore:String) [], CommandNotF 
       oundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PM> restore "ComAndGet"
    restore : The term 'restore' is not recognized as the name of a cmdlet, 
    function, script file, or operable program. Check the spelling of the name, or 
    if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + restore "ComAndGet"
    + ~~~~~~~
        + CategoryInfo          : ObjectNotFound: (restore:String) [], CommandNotF 
       oundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PM> install Microsoft.Synchronization Version=2.1.0.0
    install : The term 'install' is not recognized as the name of a cmdlet, 
    function, script file, or operable program. Check the spelling of the name, or 
    if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + install Microsoft.Synchronization Version=2.1.0.0
    + ~~~~~~~
        + CategoryInfo          : ObjectNotFound: (install:String) [], CommandNotF 
       oundException
        + FullyQualifiedErrorId : CommandNotFoundException
     
    PM> 

    The code block above documents also my previous attempts to use other commands.

    It crossed my mind that perhaps I don't have Nuget in my Visual Studio, perhaps it has to be installed first. Is it possible?

    When I click on "Manage Nuget packages" after clicking on the project name I get a response: "No packages found."

    Thanks, - Alex


    • Edited by MyCatAlex Thursday, May 17, 2018 10:21 PM
    Thursday, May 17, 2018 10:16 PM
  • I just installed Nuget.Core by OuterCurve foundation (???) and

    Microsoft.Web.xdt by Microsoft. Perhaps now it will work?

    Thursday, May 17, 2018 10:39 PM
  • OK, I installed Nuget, it seems. There is a list of commands on the Web: "Nuget commands cheat sheet." Cheat Sheet  I used one of them and it was recognized and it gave me list of ALL packages containing "Synchronization" and "MessageBox."

    PM> Get-Package -Listavailable Synchronization
    But I don't know how to jump from this list to using some of them as references to resolve the errors. There are 5 errors all together at this time:
    Error	CS0234	The type or namespace name 'MessageBox' does not exist in the namespace 'Microsoft.SqlServer' (are you missing an assembly reference?)	ComeAndGet	C:\ComeAndGet\StaticClasses.cs	18	Active
    
    Error	CS0234	The type or namespace name 'Synchronization' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)	ComeAndGet	C:\ComeAndGet\Form1.Designer.cs	3132	Active
    
    Error	CS0234	The type or namespace name 'Synchronization' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)	ComeAndGet	C:\ComeAndGet\Form1.Designer.cs	118	Active
    
    Error	CS0234	The type or namespace name 'Synchronization' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)	ComeAndGet	C:\ComeAndGet\Form1.Designer.cs	356	Active
    
    Error	CS0234	The type or namespace name 'Synchronization' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)	ComeAndGet	C:\ComeAndGet\Form1.Designer.cs	363	Active
    
    Next Step? I think I am close to resolution. Thanks.

    Thursday, May 17, 2018 11:01 PM
  • With that in mind (that I now have Nuget installed), I tried you install suggestion again. The result is error.

    PM>  Install-Package Microsoft.Synchronization Version=2.1.0.0
    Install-Package : Project 'Version=2.1.0.0' is not found.
    At line:1 char:2
    +  Install-Package Microsoft.Synchronization Version=2.1.0.0
    +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Version=2.1.0.0:String) [Instal 
       l-Package], ItemNotFoundException
        + FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.Pow 
       erShellCmdlets.InstallPackageCommand
     
    PM> 
    The irony of this is that (as I mentioned a number of times before) I do have Microsoft.Synchronization dll in my list of references for the solution/project. It has always been there.


    • Edited by MyCatAlex Thursday, May 17, 2018 11:11 PM
    Thursday, May 17, 2018 11:08 PM
  • With that in mind (that I now have Nuget installed), I tried you install suggestion again. The result is error.

    PM>  Install-Package Microsoft.Synchronization Version=2.1.0.0
    Install-Package : Project 'Version=2.1.0.0' is not found.
    At line:1 char:2
    +  Install-Package Microsoft.Synchronization Version=2.1.0.0
    +  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (Version=2.1.0.0:String) [Instal 
       l-Package], ItemNotFoundException
        + FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.Pow 
       erShellCmdlets.InstallPackageCommand
     
    PM> 
    The irony of this is that (as I mentioned a number of times before) I do have Microsoft.Synchronization dll in my list of references for the solution/project. It has always been there.


    The reference has a yellow icon, an error, then it's not there.

    Get rid of the reference and try a later version.

    https://www.nuget.org/packages/Microsoft.SyncFramework/

    Friday, May 18, 2018 12:48 AM
  • Yes, you are correct. It has a yellow icon (! sign). I also noticed that a considerable number of other dll's in references have yellow markers also. I then followed your link, ran this command:

    Install-Package Microsoft.SyncFramework -Version 2.1.0.2

    It installed the package for sure but no improvement has been noticed. I did not remove the Microsoft.Synchronization before hand as you suggested, though. I thought the new package would take care of it.

    Besides everything I read about NuGet suggests that it is supposed to take care of all my references automatically. It is not what it is happening.

    Thank you, - Alex


    • Edited by MyCatAlex Friday, May 18, 2018 5:17 PM
    Friday, May 18, 2018 4:09 PM
  • I finally resolved all linkage problems and now I attempt to debug it. It does not run well. Too many problems because it is older software.
    • Marked as answer by MyCatAlex Sunday, May 20, 2018 6:06 PM
    Sunday, May 20, 2018 6:06 PM