dcsimg
Results 1 to 3 of 3
  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    [RESOLVED] windows service could not load file or assembly

    I have created windows services before and able to load. For this windows service solution I have two projects. When I build the project it creates the following files: base.dll, service.exe and service.exe.config. Here is how I am trying to install the windows service on a Microsoft Windows Server 2003 R2 Standard x64 Edition SP2 server:

    run cmd as administrator and enter:
    C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil "C:\Service\service.exe"

    The return I get is:
    Exception occurred while initializing the installation: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Service\service.exe' or one of it's dependencies. The system cannot find the file specified.

    Here is how I have my solution in Visual Studio 2010:
    -Base (a base project that will be shared for different services)
    --My Project
    --References
    --bin
    --obj
    --app.config
    --mainclass1.vb
    --anotherclass2.vb
    --anotherclass3.vb

    -service (the unique code for this service)
    --My Project
    --References
    --ServiceReferences
    --Web References
    --bin
    --obj
    --app.config
    --main.vb
    --anotherclass1.vb
    --anotherclass2.vb
    --modGlobal.vb
    --ProjectInstaller.vb
    --Service1.vb

    My main questions:
    1) Does the 'base' project when compiled to base.dll include it's associated app.config file?
    2) Is there a way to determine what the missing file is that it says I am missing?

    Some other settings in Visual Studio 2010 solution:
    Application > Application type > Windows service
    Application > Startup object > Service1
    Compile > Advanced Compiler Settings > TargetCPU > AnyCPU
    Compile > Advanced Compiler Settings > Target framework > .NET Framework 3.5

    Thanks for any help or ideas for me to try.
    Last edited by lleemon; Mar 13th, 2013 at 04:46 PM. Reason: Resolved

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2000
    Location
    Minnesota
    Posts
    830

    Re: windows service could not load file or assembly

    Figured it out. I had typed in C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil "C:\Service\serviice.exe" instead of C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil "C:\Service\service.exe"

  3. #3
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,242

    Re: [RESOLVED] windows service could not load file or assembly

    serviice.exe
    Aye, aye, Cap'n!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width