autofac / Autofac

An addictive .NET IoC container
https://autofac.org
MIT License
4.47k stars 836 forks source link

I cant compile successfully. #513

Closed liukuo362573 closed 10 years ago

liukuo362573 commented 10 years ago

I downloaded the source code zip file of Autofac ,my computer install VS 2012,I open Autofac.sln,then I compile project,but I can't compile successfully. Who can tell me why?

I found Reference of Autofac class libaray is empty.

alexmg commented 10 years ago

You will need to provide more information than this if you want someone to help you. What are the compile errors you are receiving? Do you need to compile from source or can you use the NuGet package?

liukuo362573 commented 10 years ago

I want to compile from source,here this input editor can't upload image

liukuo362573 commented 10 years ago

There are 320 errors when I compile Autofac one class libaray. it seems it references nothing.

liukuo362573 commented 10 years ago

错误 138 未能找到类型或命名空间名称“Stack”(是否缺少 using 指令或程序集引用?) E:\My\Autofac-master\Core\Source\Autofac\Core\Resolving\ResolveOperation.cs 38 18 Autofac 错误 215 未能找到类型或命名空间名称“Stack”(是否缺少 using 指令或程序集引用?) E:\My\Autofac-master\Core\Source\Autofac\Core\Disposer.cs 41 9 Autofac 错误 305 未能找到类型或命名空间名称“Stack”(是否缺少 using 指令或程序集引用?) E:\My\Autofac-master\Core\Source\Autofac\Core\Resolving\CircularDependencyDetector.cs 58 92 Autofac 错误 86 未能找到类型或命名空间名称“Queue”(是否缺少 using 指令或程序集引用?) E:\My\Autofac-master\Core\Source\Autofac\Core\Registration\ServiceRegistrationInfo.cs 23 9 Autofac 错误 322 未能找到类型或命名空间名称“ParameterExpression”(是否缺少 using 指令或程序集引用?) E:\My\Autofac-master\Core\Source\Autofac\Features\GeneratedFactories\FactoryGenerator.cs 178 55 Autofac 错误 9 未能找到类型或命名空间名称“LinkedList”(是否缺少 using 指令或程序集引用?) E:\My\Autofac-master\Core\Source\Autofac\Core\Registration\ServiceRegistrationInfo.cs 18 18 Autofac 错误 296 未能找到类型或命名空间名称“Expression”(是否缺少 using 指令或程序集引用?) E:\My\Autofac-master\Core\Source\Autofac\Builder\MetadataConfiguration.cs 53 64 Autofac 错误 310 未能找到类型或命名空间名称“Expression”(是否缺少 using 指令或程序集引用?) E:\My\Autofac-master\Core\Source\Autofac\Util\ReflectionExtensions.cs 67 13 Autofac

vikramjb commented 10 years ago

Expand the references section of the project and see if there is a error/warning icon on any of the references.

liukuo362573 commented 10 years ago

I cant expand the reference section in Core->Autofac,the reference is empty,others project can.

vikramjb commented 10 years ago

I am referring to the Assembly references section of the project. And what do you mean the Core->Autofac is empty ? Can you share a screenshot ?

liukuo362573 commented 10 years ago

I have a screenshot :

vikramjb commented 10 years ago

What's your version of Visual Studio ? For me, VS Express 2012 did not load some of projects in AutoFac.

liukuo362573 commented 10 years ago

I use Visual Studio Ultimate 2012 of Chinese Version. It disappoints me.crazy

vikramjb commented 10 years ago

When you open the project, did it show any alerts or information window ?

liukuo362573 commented 10 years ago

Autofac-master\Examples\DomainServicesExample\DomainServicesExample.csproj Load error

vikramjb commented 10 years ago

And what was the error ?

liukuo362573 commented 10 years ago

I know the reason,it is .Net Portable Class Library. Now Most of open source libraries are being released with portable support.

shiftkey commented 10 years ago

@lhking can you share a screenshot of the version of VS you are running? It's likely to be different text for your version, but it should be in the same spot:

screen shot 2014-04-16 at 1 36 39 pm

Here's my VS2012 for reference (I'm going to clone down the Autofac repo now and test it out):

screen shot 2014-04-16 at 1 35 48 pm

shiftkey commented 10 years ago

So these are some incompatible projects which I see when opening the solution in VS2012 Update 4.

screen shot 2014-04-16 at 2 22 19 pm

And the DomainServicesExample project raises a specific message:

screen shot 2014-04-16 at 2 19 52 pm

I think it's because I don't have the right components installed

Examples\EnterpriseLibraryExample.MvcApplication\EnterpriseLibraryExample.MvcApplication.csproj: The Web Developer Tools option must be installed prior to opening or creating Web projects. You can install this option by repairing your Microsoft Visual Studio installation and ensuring that 'Web Developer Tools' is checked in the list of optional components

tillig commented 10 years ago

Can you try it with VS2013? We have a read me for devs (developer.html) in the source outlining the prerequisites for building - we've been using 2013 for a while now.

shiftkey commented 10 years ago

Yup, seems I've done a bad thing (see the last two items are unchecked):

screen shot 2014-04-16 at 2 25 17 pm

I bet it's the same with VS2013.

shiftkey commented 10 years ago

@tillig

Can you try it with VS2013? We have a read me for devs (developer.html) in the source outlining the prerequisites for building - we've been using 2013 for a while now.

Sure can, but the prerequisites don't specify which VS features you need to have :grinning:

liukuo362573 commented 10 years ago

@shiftkey ,I think I should install .Net Framework 4.5.1,but when I finished installing,My Vs 2012 cant open,now I am uninstalling and ReInstall Vs 2012.it's frustrating.

liukuo362573 commented 10 years ago

Readme for Autofac Developers writes Developer Environment is Visual Studio 2013,I am wrong

alexmg commented 10 years ago

We moved to Visual Studio 2013 a while ago. There are a lot more things using NuGet now than in the past, but you will need the Silverlight bits for the WCF RIA Services example.

tillig commented 10 years ago

OK, I updated the dev doc with the appropriate component info for building using VS 2013. I'm going to go ahead and close this issue; if it turns out there are still challenges building using the prescribed environment, feel free to re-open.

stratopost commented 7 years ago

I just downloaded Autofac-developer & Autofac-master source as on today and unable to load / compile into visual studio 2013. Error as are as foloows:

image

image

image

tillig commented 7 years ago

This issue is three years old. We're on VS 2017 now.