MVCPlayer resources issue

Topics: MVC, Troubleshooting
Jan 26, 2011 at 9:59 AM

Hi Composite,

I am trying to add a complete MVC application inside Composite using the MVCPlayer and I'm stuck with this error:

20110126 11:48:01.0084 3 12 Error PageRenderer | INNER | INNER | INNER 

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.IO.FileNotFoundException: Could not find file 'App_Code.zm71z62u.resources'.

at System.Reflection.RuntimeAssembly.InternalGetSatelliteAssembly(String name, CultureInfo culture, Version version, Boolean throwOnFileNotFound, StackCrawlMark& stackMark)

at System.Resources.ManifestBasedResourceGroveler.GetSatelliteAssembly(CultureInfo lookForCulture, StackCrawlMark& stackMark)

at System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(CultureInfo culture, Dictionary`2 localResourceSets, Boolean tryParents, Boolean createIfNotExists, StackCrawlMark& stackMark)

at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)

at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)

at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)

at ViewRes.SharedStrings.get_Title()

at ASP.views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer)

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)

at System.Web.UI.Control.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)

at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)

at System.Web.UI.Page.Render(HtmlTextWriter writer)

at System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer)

at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)

at System.Web.UI.Control.RenderControl(HtmlTextWriter writer)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.HandleError(Exception e)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest()

at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)

at System.Web.UI.Page.ProcessRequest(HttpContext context)

at System.Web.Mvc.ViewPage.ProcessRequest(HttpContext context)

at ASP.views_home_index_aspx.ProcessRequest(HttpContext context)

at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass1.<ProcessRequest>b__0()

at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3()

at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func)

at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap(Action action)

at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.ProcessRequest(HttpContext context)

at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)

 

any help would be appriciated !

Thomas

Coordinator
Jan 26, 2011 at 10:18 AM

Judging by the stack trace Composite C1 isn't involved in the handling of this request - my best guess (without having the actual MVC app) is the something is missing (could be files or web.config settings) - looks like resource files that are not compiled or resolved.

Jan 26, 2011 at 12:23 PM
Edited Jan 26, 2011 at 1:19 PM

THanks for the quick answer,

I think my resources files have lost their properties during copy. They know don't have Build action anymore.

 Do you have an insight for that ?

--

I have referenced the MVC project I want to merge with Composite and I don't have the problem now.

 I wonder if referencing the entire MVC Application is a good thing to do : Should I build an assembly containing only my resources to reference in the composite website ?

Sincerly,

Thomas

Jan 26, 2011 at 3:30 PM

if you only need to retrieve some resources from the assembly you don't need to reference it. References are only for the compiler to resolve types and compile-time, and since resources are retrieved at runtime the compiler doesn't need to know about them. Just make sure the necessary assemblies are present in the /bin folder when running the application.

Side note: making a reference will make sure the compiler will copy the references assemblies to the bin-folder at compile time, which could be why you're experiencing that it works after referencing the project. This is a side effect though.

Jan 26, 2011 at 4:13 PM

Thank you burningice,

I agree with you. What I have done trying to merge my website the fastest way, is to copy all my stuff in the app_code directory (except the views) and then I ended after not so much trying to put Scripts and Content out of this directory. Resources seems to be lost during compilation or something. I've tried to put them in the App_GlobalResources directory without success. I've remarked that they've lost their Custom Tool  PublicResXFileCodeGenerator and build action properties since I've copied them to the new solution. So I subsume they are not include in the .dll

Can you wise me about dealing with them ?