Re: Setting up a web project to use the aspnetwebstack assemblies

Apr 18, 2012 at 12:21 AM
Kind of newb question here, but does anyone have a post with step by step instructions setting up a web project to use the aspnetwebstack libraries with the MVC 4 project template? Obviously you can just replace the default references with Browse references to the ones that are more current in the web stack ones, but I am running into the failure to load exceptions that make me think there are dependencies there that I am not getting correct.

Thanks
Brian

--
-----------------------------------------
Brian Noyes
Chief Architect, IDesign Inc
Microsoft Regional Director / MVP
http://www.idesign.net
+1 703-447-3712
-----------------------------------------

--
-----------------------------------------
Brian Noyes
Chief Architect, IDesign Inc
Microsoft Regional Director / MVP
http://www.idesign.net
+1 703-447-3712
-----------------------------------------



Apr 18, 2012 at 12:43 AM
Edited Apr 18, 2012 at 12:44 AM

Did you perform step 3. listed here: http://aspnetwebstack.codeplex.com/documentation ?

Just replacing the references should work (but you cannot have MVC 4 runtime installed on your machine).

Apr 18, 2012 at 11:46 AM
Have done that.

The particular error I'm on right now is:
Could not load type 'System.Net.Http.HttpClientExtensions' from assembly 'System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

When I try to use HttpClient.PostAsJsonAsync, even though I have the System.Net.Http.Formatting assembly referenced from the \bin folder of my aspnetwebstack built assemblies, and it compiles fine.

On Tue, Apr 17, 2012 at 7:44 PM, marcind <notifications@codeplex.com> wrote:

From: marcind

Did you perform step 3. listed here: http://aspnetwebstack.codeplex.com/documentation

Read the full discussion online.

To add a post to this discussion, reply to this email (ASPNETWebStack@discussions.codeplex.com)

To start a new discussion for this project, email ASPNETWebStack@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

--
-----------------------------------------
Brian Noyes
Chief Architect, IDesign Inc
Microsoft Regional Director / MVP
http://www.idesign.net
+1 703-447-3712
-----------------------------------------



Apr 18, 2012 at 1:51 PM

Did you remember to uninstall MVC 4? The installer puts several libraries in the GAC, and they have the same version as the libraries you just built, so the ones in the GAC will be the ones that get used at runtime, regardless of which ones you linked against.

Note that you only need to uninstall the runtime. You should be able to leave the tooling installed.

Apr 18, 2012 at 3:31 PM
I guess that is where I am confused. HttpClient lives in System.Net.Http which gets installed with MVC 4. That assembly isn't in the open source stack. When I uninstall MVC 4 that goes away, so how do I use HttpClient with the new extensions?

On Wed, Apr 18, 2012 at 8:51 AM, BradWilson <notifications@codeplex.com> wrote:

From: BradWilson

Did you remember to uninstall MVC 4? The installer puts several libraries in the GAC, and they have the same version as the libraries you just built, so the ones in the GAC will be the ones that get used at runtime, regardless of which ones you linked against.

Note that you only need to uninstall the runtime. You should be able to leave the tooling installed.

Read the full discussion online.

To add a post to this discussion, reply to this email (ASPNETWebStack@discussions.codeplex.com)

To start a new discussion for this project, email ASPNETWebStack@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

--
-----------------------------------------
Brian Noyes
Chief Architect, IDesign Inc
Microsoft Regional Director / MVP
http://www.idesign.net
+1 703-447-3712
-----------------------------------------



Apr 18, 2012 at 6:42 PM
There is a NuGet package available for it. It doesn't need to be in the GAC to run (and in fact, post-Beta, none of the Web API DLLs will be in the GAC after installation).

Apr 19, 2012 at 12:43 AM
Thanks, that was the missing piece for me.

So is this an accurate approach to set up a clean machine but use the latest bits:
- VS 2010 SP1
- Install the MVC 4 Beta Web Platform Installer package (which installs tools and the MVC 4 Beta)
- Uninstall the "Microsoft ASP.NET MVC 4 Beta" item (not the Tools one)
- Clone and build the aspnetwebstack OSS code
- Get the System.Net.Http NuGet package
- When you create an MVC 4 project, replace the references in the project that have aspnetwebstack binaries with refs to the ones in the aspnetwebstack

Any other "replace what you uninstalled" Nuget packages out there besides System.Net.Http to be aware of that I haven't hit yet?

Thanks

On Wed, Apr 18, 2012 at 1:43 PM, BradWilson <notifications@codeplex.com> wrote:

From: BradWilson

There is a NuGet package available for it. It doesn't need to be in the GAC to run (and in fact, post-Beta, none of the Web API DLLs will be in the GAC after installation).

Read the full discussion online.

To add a post to this discussion, reply to this email (ASPNETWebStack@discussions.codeplex.com)

To start a new discussion for this project, email ASPNETWebStack@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

--
-----------------------------------------
Brian Noyes
Chief Architect, IDesign Inc
Microsoft Regional Director / MVP
http://www.idesign.net
+1 703-447-3712
-----------------------------------------