Home Dashboard Directory Help
Search

Referenced Assembly could not be resolved because it has a dependency conflict by Nuke


Status: 

Closed
 as By Design Help for as By Design


10
0
Sign in
to vote
Type: Bug
ID: 510573
Opened: 11/14/2009 10:27:51 AM
Access Restriction: Public
4
Workaround(s)
view
11
User(s) can reproduce this bug

Description

Namespace of a project assembly was not reconginzed after adding other assemblies.
Getting the following warning:
warning MSB3253: The referenced assembly "C:\Users\nuke\Documents\Visual Studio 2010\Projects\TechnoPhoenix\tPhoenix\AlphaVoltManager\bin\Debug\AlphaVoltManager.dll" 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".
Details
Sign in to post a comment.
Posted by Medinoc on 1/22/2014 at 6:03 AM
I think the big part of the problem is that the warning is misleading: It says the DLL has a dependency on System.Web, even when it does not.
It seems that making a DLL that targets the full framework inserts a "fake" dependency to System.Web, causing the befuddling warning message.
Posted by LK liszt on 7/30/2013 at 6:25 PM
Thanks a lot!
Posted by chris8229 on 7/10/2012 at 8:36 PM
hi, I am facing the same problem as mentioned above. Anyone can teach me how to solve?
Thanks
Posted by MaJoBeats on 12/19/2011 at 6:21 AM
Thanks a lot .This fixed my issue
Posted by PeteFromAdelaide on 7/10/2011 at 10:35 PM
Excellent. Fixed my issue as well.
Posted by Carpet King on 6/10/2011 at 2:21 PM
Thanks alot, that helped me make some headway too.
Posted by petertraco on 5/31/2011 at 10:41 AM
Thanks a lot . It help my project build sucessfully !!
Posted by Boeffect on 10/21/2010 at 12:34 PM
Thanks a lot! it resolved my issue!!
Posted by Yang Jichao on 10/18/2010 at 7:32 AM
@kphani_prasad: thanks, your solution works fine on my computer.
Posted by HydTechie on 10/15/2010 at 8:33 AM
guys ! goto project properties, Application Tab would have Target Framework - set to 4.0 other than client profile, it would be resolved, I did it again...

And bashes for great MS guys out there... Holy ! you could not reproduce the steps in your lab?? Try adding System.Web to a console application.. try different things in life... Horrrrrible.............!
Posted by Tracy'S on 5/17/2010 at 6:13 PM
I am experiencing the same behavior, following are my specs. Please advise ASAP.


Microsoft Visual Studio 2010
Version 10.0.30319.1 RTMRel
Microsoft .NET Framework
Version 4.0.30319 RTMRel
Posted by bccollin on 5/5/2010 at 12:10 PM
I am currently getting this issue with the final release version of Visual Studio 2010 but only when I am running MSBuild from the command line.

It may have something to do with starting MSBuild from a bat file:

"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild" PersonalBuildScript.proj /p:BuildDatabase=%1;GetLatest=%2
pause


errors:
"C:\Source\VS.NET\PersonalBuildScript.proj" (default target) (1) ->
"C:\Source\VS.NET\WinApplications\SSCL.SQS.WIN\SSCL.SQS.WIN.sln" (default targe
t) (30) ->
"C:\Source\VS.NET\WinApplications\SSCL.SQS.WIN\SSCL.SQS.WIN\SSCL.SQS.WIN.csproj
" (default target) (31) ->
CSC : warning CS1607: Assembly generation -- Referenced assembly 'mscorlib.dl
l' targets a different processor [C:\Source\VS.NET\WinApplications\SSCL.SQS.WIN
\SSCL.SQS.WIN\SSCL.SQS.WIN.csproj]
CSC : warning CS1607: Assembly generation -- Referenced assembly 'Presentatio
nCore.dll' targets a different processor [C:\Source\VS.NET\WinApplications\SSCL
.SQS.WIN\SSCL.SQS.WIN\SSCL.SQS.WIN.csproj]
CSC : warning CS1607: Assembly generation -- Referenced assembly 'System.Data
.dll' targets a different processor [C:\Source\VS.NET\WinApplications\SSCL.SQS.
WIN\SSCL.SQS.WIN\SSCL.SQS.WIN.csproj]
CSC : warning CS1607: Assembly generation -- Referenced assembly 'System.Ente
rpriseServices.dll' targets a different processor [C:\Source\VS.NET\WinApplicat
ions\SSCL.SQS.WIN\SSCL.SQS.WIN\SSCL.SQS.WIN.csproj]
Posted by redmoon on 3/2/2010 at 11:53 PM
I also got the same exact problem today with RC.
Unfortunately,if you get this warning, then get error - cannot find "ClassLibrary1" namespace
Posted by Udai on 2/22/2010 at 4:33 PM
I got the same exact problem today with RC.
Warning    1    The referenced assembly "C:\TempWork\MyCore.dll" 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. Any resolution?
Posted by AJDotNEt on 2/20/2010 at 10:41 AM
I am gettign an exact similar errror with our project. I am running VS 2010 RC version on Windows XP.

I get the following error:

The referenced assembly "C:\myDir1\dir2\dir3\bin\Debug\someDLL.dll" 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.

By looking at the seemblies on my system I see that the runtime assembly for System.web is version 4.0.0.0 while .NET framework 4.0 (the release version) now has the version of System.web as 4.0.3. And from inside VS 2010 when you add a reference to System.web it picks up the V4.0.3 version, but then the runtime is V4.0.0. And hence I am getting the following error:


This is truly blocking me and I can not do anything unless this is resolved. PLEASE ADVISE.

Thank you,
Posted by ananda vardhana on 2/1/2010 at 10:54 AM
Hi Josseff,

You mention that the warning's have been fixed in the RC/RTM version of VS2010. Please let me know if it is available for MSDN subscribers? I really need to get rid of the warnings to confirm some issues I have with my 64 bit program to make sure if it is my mistake or the manifestation of the warnings. 
thanks very much
Posted by Jossef on 12/11/2009 at 2:24 PM
Hi
Thanks so much for reporting this.
to recap the first issues:
This is related to Connect bug id 519390.
By default , Dev10 beta2 Winform & WPF projects targets Net4 Client Profile (new in Beta2).
Systrem.web is not included in the NET4 Client profile.
To fix the issue retarget your project to NET4 Full, or remove dependency on System.web.

See more here: http://blogs.msdn.com/jgoldb/archive/2009/10/19/what-s-new-in-net-framework-4-client-profile-beta-2.aspx

WRT to the 2nd issue reported (below warnings when compile to x64) , I believe that this is fixed in latest RC & RTM builds.

warning CS1607: Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor
warning CS1607: Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor
warning CS1607: Assembly generation -- Referenced assembly 'System.Web.dll' targets a different processor

Jossef
MSFT
Posted by JCorker on 12/11/2009 at 9:52 AM
I have a similar problem to the original post. I have created a new CodeActivity class for use with TFS Team Build 2010, and this requires a reference to Microsoft.TeamFoundation.Build.Client unfortunately when I try and build it errors saying that is has a dependency like the above on "System.Web, Version=4.0.0.0 etc.
This error is removed by changing to compile with full .NET 4 and not the client version, but then I can not use this with TFS.
Posted by Rodri-79 on 12/10/2009 at 4:16 AM
I am experimenting some errors trying to connect a Windows Console project (Project 1 - ConsoleApplication1) with an existing Test project (Project 2 - QVWData).

When compiling Project 2 (Test) I don't find any error and, when trying to compile the Console we can see the following Warings (3):
- The referenced assembly "QVWData, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" 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".
- The referenced assembly "QVWData, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".
- The referenced assembly "QVWData, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Drawing.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client".

And 1 Error (1):
- Error    1    The type or namespace name 'QVWData' could not be found (are you missing a using directive or an assembly reference?)    C:\Documents and Settings\user1\Mis documentos\Visual Studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs    

Thanks for your help!!!

Posted by Jossef on 11/30/2009 at 12:46 PM
Hi
Starting in VS10 beta2, by default:
- When you create Windows projects (e.g. Winoform WPF, Console) . it targets Net4 Client Profile
- When you create new Class Library project it targets Net4 Full (However, notice that by default it does not add any references to assemblies Net4 full)

If you reference the Class Library in your Net4 Client Profile project, you can still compile the project.
However, if you add to the Class Library project assemblies that are not in Net4 Client Profile you are going to get the warnings/errors that you encounter.
To fix the issues:
a)    In the Class Library, do not add references to assemblies not in Net4 Client Profile, or
b)    Modify the Windows project to target NET4 full
Please see more in thi sblog:
http://blogs.msdn.com/jgoldb/archive/2009/10/19/what-s-new-in-net-framework-4-client-profile-beta-2.aspx

Note: we are still investigating the warnings you noticed when you build for x64
Thank you
Jossef
Posted by Microsoft on 11/21/2009 at 1:05 AM
Thanks for your feedback.

We were able to reproduce the issue you are seeing. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Nuke on 11/20/2009 at 3:38 PM
Actually I can not build an x64 solution where a System.Web reference is needed. I'll leave it in this thread instead of openning a new bug since I think this is the gist of the problem.
Posted by Nuke on 11/20/2009 at 3:32 PM
Unfortunatty this involves some propriatery assemblies. One thing I would recommend looking into is the mixed platforms (I'm using Windows 7 64 bit). I noticed that when I target everything to x64 I get the warnings:

warning CS1607: Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor
warning CS1607: Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor
warning CS1607: Assembly generation -- Referenced assembly 'System.Web.dll' targets a different processor

It is a guess. May or may not be related.
Posted by Microsoft on 11/19/2009 at 10:26 PM
Thanks for all the feedbacks.

I tried the two ways but I was still unable to reproduce the issue. Could you attach a zipped project file to this feedback through our site?
Posted by Nuke on 11/19/2009 at 3:20 PM
Possibly similar. My flow is like this:
1) Create solution with project targeting .Net 4
2) Reference assemblies compiled for .Net 2.x referencing the System.Web assembly
3) Compile
4) The above warning is shown and the assembly can not be referenced by other .Net 4 assemblies.
Posted by Will Sullivan on 11/16/2009 at 7:52 AM
I've encountered this as well. Repro steps (possibly!);

1) create a dll that targets the full 4.0 framework
2) create a new solution targeting the 4.0 client profile
3) Reference the dll from the new project
4) Attempt to use a type defined in the dll
Posted by Microsoft on 11/16/2009 at 1:32 AM
Thanks for reporting the issue.
In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

Could you please attach a zipped project file to help us reproduce the issue?

Thanks again for your efforts and we look forward to hearing from you.
Visual Studio Product Team
Sign in to post a workaround.
Posted by crotticlaudio050 on 3/8/2013 at 12:41 PM
Vorrei sapere come risolvere il problema se qualcuno ci è riuscito melo faccia sapere grazie.
Posted by nLav on 6/30/2011 at 10:09 AM
Thanks a lot Tracy ur workaround resolved mine !!!

"The 'Profile=Client' is what is causing this. System.Web is not part of Client profile (see list of DLLs).
Target full framework in VS (see Project properties) and you should be fine."
Posted by MJ Hufford on 9/12/2010 at 9:26 PM
tlsterling - THANK YOU!
Posted by Tracy'S on 5/17/2010 at 6:31 PM
Geez, how about at least EXPLAINING the behavior and how to get around it before you just close the ticket with 'By Design'?!

Fortunately the community came thru again on this one: http://social.msdn.microsoft.com/Forums/en/netfxappcompatprerelease/thread/ad71e8e5-3124-47de-89cb-97b1d2d4263a.

The 'Profile=Client' is what is causing this. System.Web is not part of Client profile (see list of DLLs).
Target full framework in VS (see Project properties) and you should be fine.