Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6223925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:34:31+00:00 2026-05-24T08:34:31+00:00

This is a weird one. I created a new Windows Service in C#, and

  • 0

This is a weird one.

I created a new Windows Service in C#, and want to re-use some of the code we created before that’s in a Class Library.

The project is loaded in the solution along with the service. Both target .NET Framework 4.0 (not client profile).

I tried adding a project reference, and it worked for a short while. After working on some old code that I was rewriting, when the project compiled again, it complained that it no longer recognised the namespace for the using statement.

I’ve made sure to clean the solution & rebuild, but no dice. Sometimes VS can have a bad day, so I restarted VS, but this also didn’t work.

I then build the DLL, and add a reference to it via ‘browse’, also no dice. Then I tested it on another project, but after adding it, it works instantly, so it’s not the DLL.

I then checked with other libraries in the solution, but I was able to add a reference to them in the service and access their namespace without a problem.

I’m out of ideas here, anyone got an idea of what to do here?

Thanks,

Nick.

Almoast forgot: the weird thing is, that if I open up the Class view, and expand the ‘References’ section, the namespace/dll doesn’t show up there either… it’s a real conundrom…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:34:32+00:00Added an answer on May 24, 2026 at 8:34 am

    I should pay more attention to warnings:

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3253: The referenced assembly “” could not be resolved because it has a dependency on “System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” which is not in the currently targeted framework “.NETFramework,Version=v4.0,Profile=Client”. Please remove references to assemblies not in the targeted framework or consider retargeting your project.

    So, I’m a ready idiot for checking the DLL’s target framework but not the Windows Service 🙂

    The problem is my DLL uses System.Web, which is not part of the .NET 4 Client Profile framework target. Changing the Service’s Target Framework to 4.0 fixed it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Boy, this one is really weird. I expect the following code to print 1990,
Ok, this one is really weird... I can't show code for it exactly cause
This is a really strange one. I've created my own CustomTextField class which I
This is a bit of weird scenario. I had a class that was quickly
This is a weird one. I am trying to use Views in MySQL (I'm
This is a weird one, but hopefully someone can give me an idea here.
This is a weird one, and unfortunately I can't test it. At my company
Ok, this is a really weird one. I have an MPI program, where each
I know this one is the weirdest of all weird questions I have asked
This is a weird question inasmuch as I've definitely had projects that work fine,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.