Telerik.Sitefinity.Feather version 1.4.410.0 and razor pre compiling
Hey,
I've recently tried an update to the latest versions of Sitefinity and Feather and I'm not stuck with some problems around the new razor compiling of resource pacakages.
I have a site project named "Foo.Site" (with Foo being a customer name). And then a resource package folder called "Foo".
With the razor compilation I'm getting a errors due to the namespace that is being generated for the compiled views. The namespace (Foo.Site.ResoucePackages.Foo.* or something like that) is overriding being able to access Foo.Site.Models etc. for my widget viewmodels etc.
This causes a problem, as I'm now stuck with either renaming the resource package to something else (doable, but a last resort as the current naming is correct? and I would be making it obscurer for the sake of getting this to work) or working out some way to get the razor compilation to work under a different namespace (which I don't know how to do).
Is there something else that I'm missing? Am I doing something wrong? Advice would be greatly appreciated.
I got around this first issue by doing some tweaks with global:: usings in the razor files and making a couple of tweaks.
However I now have the following issue when trying to compile
SeverityCodeDescriptionProjectFileLineSuppression State
ErrorUnable to load assembly 'Foo.Sitefinity, Version=1.0.5870.29793, Culture=neutral, PublicKeyToken=null' : Could not load file or assembly 'Telerik.Sitefinity.Model, Version=8.2.5900.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500)
ExceptionString:
System.SystemException: Unable to load assembly 'Foo.Sitefinity, Version=1.0.5870.29793, Culture=neutral, PublicKeyToken=null' : Could not load file or assembly 'Telerik.Sitefinity.Model, Version=8.2.5900.0, Culture=neutral, PublicKeyToken=b28c218413bdf563' or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500) ---> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeModule.GetTypes()
at System.Reflection.Assembly.GetTypes()
at Telerik.OpenAccess.Metadata.MetadataAttributesReader.PrepareMetaModelTypes(Assembly assembly)
--- End of inner exception stack trace ---
at Telerik.OpenAccess.Metadata.MetadataAttributesReader.PrepareMetaModelTypes(Assembly assembly)
at Telerik.OpenAccess.Metadata.MetadataAttributesReader.ReadMetaModel(Assembly assembly)
at Telerik.OpenAccess.Metadata.AttributesMetadataSource.<>c__DisplayClass1.<FromAssembly>b__0()
at Telerik.OpenAccess.Metadata.AttributesMetadataSource.CreateModel()
at Telerik.OpenAccess.Metadata.MetadataSource.GetModelCore(MetadataContainer old)
at Telerik.OpenAccess.Sdk.Enhancer.Enhancer.CrossDomainRunImpl(AssemblyLoader assemblyLoader)
at Telerik.OpenAccess.Sdk.Enhancer.EnhancerBase.CrossDomainRun()Foo.SitefinityD:\git\foo\Foo.Sitefinity\Foo.Sitefinity\obj\Debug\Foo.Sitefinity.dll
I can get around this by removing the hook for OpenAccess in the .targets file in the nuget packages (obviously this isn't sustainable) and can then build and run the site.
Without a way forward with this I wont be able to go ahead with the latest version.
Hello,
Regarding the problem with the enhancer, this is a known issue. Please, refer to this KB article:
http://www.sitefinity.com/developer-network/knowledge-base/details/after-update-to-feather-v.1.4.410.0-can-t-enhance-openaccess-inside-sitefinity-application-anymore
Could you please specify whether the Foo.Site is the assembly name and the namespace used for the Sitefinity web application or this is an external assembly?
Regards,
Nikola Zagorchev
Telerik
Foo.Site is the assembly name and namespace.
Then the razor compiler creates an namespace in Foo.Site.ResourcePackages.Foo.etc which is where the conflict comes in for referencing Foo.Site.Model namespaces etc.
Hi,
Please, refer to this KB article for more details on this issue and workarounds available:
http://www.sitefinity.com/developer-network/knowledge-base/details/feather-cannot-build-project-that-has-resource-package-name-as-the-assemblyname-and-views-are-precompiled
Regards,
Nikola Zagorchev
Telerik