LinFu
LinFu copied to clipboard
Unable to Weave under 3.5?
Is it expected that you cannot use the current git source unless you're using .NET 4? As soon as I add the post-weave task in a 3.5 targeted project, VS complains:
Warning 2 The primary reference "\LinfuLib.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets 1360 9 Linfu35Test
Looking at my Linfu.AOP.Tasks DLL in Reflector shows references to both mscorlib 2 and 4, and I have no idea how it's getting those.. (This is a locally built DLL, but the same problem applies with the 2.3 package from github).
Thanks.
Are you using the Master branch, or the experimental LinFu v3 branch? LinFu AOP was built for .NET 3.5, so you shouldn't be having any issues
Hi,
Philip, First of all I would like to thank you for the project to the open source comunity.
I have been able to reproduce the issue in master branch:
Steps:
- Download and unzip master version.
- Install ILmerge latest version: 2.12.0803
- go to root of master unzip, execute go.bat (everything compiles OK and the core.dll is generated)
- Copy the generated dll and pdbs and XMLs to LinFu-master\examples\LinFu.AOP.Samples\lib
- Open VS 2010 and solution LinFu-master\examples\LinFu.AOP.Samples\LinFu.AOP.Samples.sln
- Downgrade runtime version to 3.5 in both projects and build. The library is not propertly waved and the references are lost.
Error 1 The type or namespace name 'SampleLibrary' could not be found (are you missing a using directive or an assembly reference?) \LinFu-master\examples\LinFu.AOP.Samples\LinFu.AOP.MethodInterceptionSample\Program.cs 9 7 LinFu.AOP.MethodInterceptionSample
If I just put it in 4.0, it works perfectly.
Any help would be appreciated as right now we can't afford to upgrade VS of all our development team.
Thanks!
JL
Hi JL,
That's because VS2010 is giving a warning that says:
"Warning 2 The primary reference "D:\Development\LinFu\examples\LinFu.AOP.Samples\SampleLibrary\bin\Debug\SampleLibrary.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. LinFu.AOP.MethodInterceptionSample"
Try creating a new sample solution in VS2010 that targets 3.5, copy the sample source files to that project, copy the assembly references, and let me know if that works for you.
On Thu, Jul 4, 2013 at 10:52 PM, jlpedrosa [email protected] wrote:
Hi,
Philip, First of all I would like to thank you for the project to the open source comunity.
I have been able to reproduce the issue in master branch:
Steps:
- Download and unzip master version.
- Install ILmerge latest version: 2.12.0803
- go to root of master unzip, execute go.bat (everything compiles OK and the core.dll is generated)
- Copy the generated dll and pdbs and XMLs to LinFu-master\examples\LinFu.AOP.Samples\lib
- Open VS 2010 and solution LinFu-master\examples\LinFu.AOP.Samples\LinFu.AOP.Samples.sln
- Downgrade runtime version to 3.5 in both projects and build. The library is not propertly waved and the references are lost.
Error 1 The type or namespace name 'SampleLibrary' could not be found (are you missing a using directive or an assembly reference?) \LinFu-master\examples\LinFu.AOP.Samples\LinFu.AOP.MethodInterceptionSample\Program.cs 9 7 LinFu.AOP.MethodInterceptionSample
If I just put it in 4.0, it works perfectly.
Any help would be appreciated as right now we can't afford to upgrade VS of all our development team.
Thanks!
JL
— Reply to this email directly or view it on GitHubhttps://github.com/philiplaureano/LinFu/issues/10#issuecomment-20475384 .
Hi Phillip,
Thanks for your answer.
I did not get the error you got. Anyway I followed the steps you suggested... Funny enough I get the error you are talking about despite the solution was created from scratch using 3.5 and also the error I mentioned before..
Error 1 The type or namespace name 'SampleLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Users\joseluis.pedrosa\Desktop\LinFu-3.5 project\LinFu-master\LinFu-master\Scratch-sol\LinFuTest\LinFuTest\Program.cs 9 7 LinFuTest
Warning 2 The primary reference "C:\Users\joseluis.pedrosa\Desktop\LinFu-3.5 project\LinFu-master\LinFu-master\Scratch-sol\LinFuTest\DemoLibraryTest\bin\Debug\DemoLibraryTest.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. LinFuTest
I am 100% sure it is created from scratch in 3.5. So I decompiled the DemoLibraryTest.dll.
If I don't wave it, it only contains a reference to mscorelib. 2. If I wave it, it contains a references to mscorelib 2 and 4, and linfu.core ver 2.3.4
And despite it contains the classes in the namespace it is not readble anymore by VS. And compilation fails.
Please have a look at the screenshot, the first one is unwaved.
'Unwaved'? Did you mean 'unwoven'? Unfortunately, I'm not working on LinFu, and I can no longer support .NET Framework versions prior to 4.0.
-Philip Laureano
On Sat, Jul 6, 2013 at 7:55 AM, jlpedrosa [email protected] wrote:
Hi Phillip,
Thanks for your answer.
I did not get the error you got. Anyway I followed the steps you suggested... Funny enough I get the error you are talking about despite the solution was created from scratch using 3.5 and also the error I mentioned before..
Error 1 The type or namespace name 'SampleLibrary' could not be found (are you missing a using directive or an assembly reference?) C:\Users\joseluis.pedrosa\Desktop\LinFu-3.5 project\LinFu-master\LinFu-master\Scratch-sol\LinFuTest\LinFuTest\Program.cs 9 7 LinFuTest
Warning 2 The primary reference "C:\Users\joseluis.pedrosa\Desktop\LinFu-3.5 project\LinFu-master\LinFu-master\Scratch-sol\LinFuTest\DemoLibraryTest\bin\Debug\DemoLibraryTest.dll" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework. LinFuTest
I am 100% sure it is created from scratch in 3.5. So I decompiled the DemoLibraryTest.dll.
If I don't wave it, it only contains a reference to mscorelib. 2. If I wave it, it contains a references to mscorelib 2 and 4, and linfu.core ver 2.3.4
And despite it contains the classes in the namespace it is not readble anymore by VS. And compilation fails.
Please have a look at the screenshot, the first one is unwaved.
[image: image]https://f.cloud.github.com/assets/4932947/755696/5bd643d0-e5bd-11e2-942a-0f81b7134d20.png
— Reply to this email directly or view it on GitHubhttps://github.com/philiplaureano/LinFu/issues/10#issuecomment-20540663 .
Hi Philip,
We will evaluate the impact of moving forward to 4.0 and VS2010.
With un-waved: I meant the libraries in which I did not apply the LinFu post build task
Thanks for your time.
Rgds
PS: According to oxford dictionary, wave is a regular verb, so it is waved: http://oxforddictionaries.com/definition/english/wave?q=wave