none
WCF fails trying to use Razor post deployment to test server? RRS feed

  • Question

  • Hi all,

    WCF application/service hosted on IIS Win2008R2 sp1, .net FW 4.5, not sure what template the project was based on but the project types are (if this makes any difference) :

    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

    This is not working on our test server.

    Fusion Logging  on reveals this info:

    === Pre-bind state information ===
    LOG: DisplayName = System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
     (Fully-specified)
    LOG: Appbase = file:///C:/inetpub/WebServices/
    LOG: Initial PrivatePath = C:\inetpub\WebServices\bin
    Calling assembly : System.Web.Mvc, Version=4.0.0.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: C:\inetpub\WebServices\web.config
    LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
    LOG: The same bind was seen before, and was failed with hr = 0x80070002.
     
    

    So my question is two parts:

    The server does have several sites that are using various versions of MVC and Razor, but I don't think the MVC stuff is "INSTALLED" on the server - does this need to be done, I would have thought all the needed assemblies would be included in the various packages installed on the DEV server, and then put into TFS... am I missing a "logical step" that explains this and/or do I need a "redirect" to a more recent (3.0?) version of System.Web.WebPages.Razor, as I've seen in various posts?

    As far as I can tell, the services don't USE any MVC features at all so is this reference (to System.Web.MVC) even needed?I'm GUESSING that the requirement MIGHT be becasue its based on a more modern VS template and includes both WCF and WebAPI2 and the MVC requirement is for the WebAPI2 stuff that we're not using... if we aren't using it then can we remove it (and if so is there a doco for how to extract the two?)

    Additional NOTES: the project in VS DOES have "System.Web" but not "System.Web.MVC" referenced in the project, so I'm assuming that this "requirement" is coming from the "parent config" files (as hinted at in the binding info, but I'm not an expert at reading these), so is there a simple way of getting around this by adding a "<somesection><clear /></somesection> to the webconfig that I'm not aware of?


    - sure I'm noJedi but that's no reason to stop trying to make stuff levitate! -

    Thursday, March 5, 2015 2:07 AM

Answers

All replies

  • Not sure if you can move this to a more suitable stream, but I think this is not a WCF issue as such, but a TFS/Build issue OR possibly a VS Solution/Project configuration issue...

    While I still (maybe) have questions about why the MVC stuff is firing the 'startup' stuff, I think that my core issue is this:

    I added a nuget package, but it looks like its DLLS are NOT being checked into the source control... from what I know the "restore package on build" is NOT active on this project, and from this I was under the impression that this being OFF would mean that DLL would be checked in as needed.

    Secondly, I note that while the WCF project itself does not include any MVC libraries, it does REFERENCE a generic utils library that does have a reference to the MVC stuff... but doesn't use any of these "MVC specific bits"...

    This is what I suspect -> while the WCF service doesn't reference these things, but libraries it DOES reference do, it SHOULD include these DLLS in deployment (and/or check-ins to source control), but for some reason they are NOT being included in the deployment...

    Do you guys have any thoughts or suggestions as to why they aren't being included in the build/check-ins? I'm not sure which it is, because there are several outputs from the build, and the web apps ARE including the DLLS needed (I fixed the TEST server temporarily, by copying a list of all "System.Web..." files into the webservers "/bin/" dir and its all working as expected now...), but I want/need to know what is missing from either the Soln/Proj configuration that is stoping the correct things being included in the checkins/build OR if there is somethign wrong with the projects configurations - ie, if you simply need to include all the same references in the "webservice" project as are included in EVERY other project it references to get it to build properly... seems redundant to me, but stranger things have happened...

    Thanks in advance.


    - sure I'm noJedi but that's no reason to stop trying to make stuff levitate! -


    • Edited by noJedi Friday, March 6, 2015 3:32 AM
    Friday, March 6, 2015 3:32 AM
    • Marked as answer by noJedi Monday, March 9, 2015 1:12 AM
    Friday, March 6, 2015 6:15 AM
  • The server does have several sites that are using various versions of MVC and Razor, but I don't think the MVC stuff is "INSTALLED" on the server - does this need to be done, I would have thought all the needed assemblies would be included in the various packages installed on the DEV server, and then put into TFS... am I missing a "logical step" that explains this and/or do I need a "redirect" to a more recent (3.0?) version of System.Web.WebPages.Razor, as I've seen in various posts?

    The MVC stuff Razor and the whole 9 yards are just .NET DLL(s) that should be deployed with the Web application when the Web application is deployed to the Web server. There is nothing to install on some Web server machine (none Web developer machine) but to install the needed components on a Web developer's machine MVC, Razor and all that stuff. 

    Friday, March 6, 2015 11:21 AM