7

I am having problems compiling an EPiServer Web Application after checking it out of Subversion.

I get this error

Compiler Error Message: CS1519: Invalid token ',' in class, struct, or interface member declaration

Source Error:

Line 116:    }
Line 117:    
Line 118:    public virtual EPiServer.Personalization.SubscriptionInfo, EPiServerSubscription Info {
Line 119:        get {
Line 120:            return ((EPiServer.Personalization.SubscriptionInfo, EPiServer)this.GetPropertyValue("SubscriptionInfo")));

Source File:

c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\956e6fc5\66c11597\App_Code.9_fan95p.0.cs    Line: 118 

As you can see from the error, this file is in the "Temporary ASP.NET Files" folder and is part of the build process. This is not my source code.

I have seen this question which suggests that the web config contains type references

specified in the "Namespace.ClassName, AssemblyName" format.

So I went into my web.config and changed the section

...
<profile ...>
    <properties>
        ...
        <add name="SubscriptionInfo"
             type="EPiServer.Personalization.SubscriptionInfo, EPiServer"
             provider="SqlProfile" />
        ...

to

...
<profile ...>
    <properties>
        ...
        <add name="SubscriptionInfo" 
             type="EPiServer.Personalization.SubscriptionInfo"
             provider="SqlProfile" />
        ...

This removed the immediate error above but then I got the same error for a different type. So I went through all the types that were in "Namespace.TypeName, AssemblyName" format and removed the ", AssemblyName". This stopped all the CS1519 errors but then I start getting CS0234:

Compiler Error Message: CS0234: The type or namespace name 'Personalization' does not exist in the namespace 'EPiServer' (are you missing an assembly reference?)

Source Error:
Line 116: }
Line 117:
Line 118: public virtual EPiServer.Personalization.SubscriptionInfo SubscriptionInfo {
Line 119: get {
Line 120: return ((EPiServer.Personalization.SubscriptionInfo)(this.GetPropertyValue("SubscriptionInfo")));

I am using VisualStudio 2008, Episerver 5.2.372.7, VisualSVN 1.7.2 and a Debian box as the Subversion repo running svn version 1.4.2 (r22196).

The application built fine, then I checked it in to the repo. Checked it out to a different location on the same computer and hit F5 and these errors start to appear.

Does anyone have any suggestions.

UPDATE: Thanks for your replies devio, Zhaph.

I have added the following to my web.config in the <compilation> section:

<assemblies>
  <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
  <add assembly="EPiServer, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.BaseLibrary, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.Configuration, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.Enterprise, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.Implementation, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.Lucene, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.Scheduler, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.Web.WebControls, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.WorkflowFoundation, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.Wsrp, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
  <add assembly="EPiServer.XForms, Version=5.2.375.7, Culture=neutral, PublicKeyToken=8fe83dea738b45b7"/>
</assemblies>

There was no <assemblies> section previously.

The project has all of those DLLs in its References. All the EPiServer DLLs are in the GAC. The new (non-working) checkout is on the same machine that the original project was created on.

I now get :

Parser Error Message: Could not load file or assembly 'EPiServer.Scheduler' or one of its dependencies. The system cannot find the file specified.

(C:\Projects\web\ProvidentPPC2\ProvidentPPC\web.config line 301)

Source Error:

Line 299:      <add name="InitializationModule" type="EPiServer.Web.InitializationModule" />
Line 300:      <!--<add name="BasicAuthentication" type="EPiServer.Security.BasicAuthentication, EPiServer" />--> 
Line 301:      <add name="Initializer" type="EPiServer.Scheduler.Initializer, EPiServer.Scheduler" />
Line 302:      <add name="WorkflowRuntime" type="EPiServer.WorkflowFoundation.WorkflowSystem" />
Line 303:      <add name="UrlRewriteModule" type="EPiServer.Web.UrlRewriteModule" />  

Source File:

C:\Projects\web\ProvidentPPC2\ProvidentPPC\web.config
Line: 301

As I say EPiServer.Scheduler is in my GAC and added to the project as a reference. Any more ideas would be greately appreciated.

Community
  • 1
  • 1
Greg B
  • 14,597
  • 18
  • 87
  • 141

8 Answers8

10

I encountered this problem as I was restructuring the dll references in a project.

I had moved the external/third part dlls from the bin folder to a library folder outside the web project root.

My problem was that some of the dll references did not have copy local set to true, so they were never copied to the bin folder on build.

Fredrik Stolpe
  • 881
  • 10
  • 14
2

It's been a while since I asked this and I keep looking thinking that I need to remember what the issue was and post the answer. I think this is it.

It turned out that there was an issue with application finding the DLLs that EPiServer installed. I'm not sure exactly and I'll update this post once I get chance to try it out on a clean machine, I'm still mid-project so it's not a very good time to be faffing about.

The way I fixed it was to get the DLLs from c:\Program Files\EPiServer\CMS\VERSION\bin and put them in the bin folder for the application.

Once I get chance to do a clean install somewhere I'll see if it is infact the project (which I doubt) or, more likely, the installation on my computer which is broken.

Greg B
  • 14,597
  • 18
  • 87
  • 141
  • 1
    Yeah i'd definately keep the dlls within the project structure and reference them from there rather than relying on the GAC. This is especially important if you want to do Continuous Integration and have all the dependencies checked in with the project. -- Lee – Lee Englestone Sep 11 '09 at 08:25
1

Have you tried referencing the EPiServer assembly correctly?

I assume that it's displaying ok in the project references node in the Solution Explorer, and hasn't got a yellow exclaim overlay on it?

Perhaps you could reference it in the web.config compilation section as well:

<compilation debug="false">
  <assemblies>
    [...]
    <add assembly="Episerver, Version=5.2.372.7"/>
  </assemblies>
</compilation>

You may either not need the version number, or you may need to add the version number and culture type - there should be a few other assemblies referenced in there already for reference.

You could also try:

<add assembly="EPiServer" />

and other variations.


Sounds like an Assembly Load issue then:

Check that the EPiServer DLL is accessable in your new location - is it installed to your computers Global Assembly Cache, or is it a local reference to the /bin folder? Is the dll in the bin folder? Is the dll included in source control?

Zhaph - Ben Duguid
  • 26,785
  • 5
  • 80
  • 117
  • Gives me "Parser Error Message: Could not load file or assembly 'EPiServer, Version=5.2.375.7' or one of its dependencies. The system cannot find the file specified." – Greg B Jul 02 '09 at 09:24
1

I ran into this several times and done it for me is when I manually copied the EPiServer assemblies to the bin folder. That works for sure but it's not very elegant. Zhaph's solution with the assemblies tag looks much nicer I'll try it next time.

1

I just had a similar problem this afternoon. The problem was that the EpiServer dlls were not present in the bin directory of the website, so I got bind failures.

The project had been created by one of my colleagues and the relevant EpiServer dlls were added as solution items in a lib folder and referenced from there. However, as he had initially created it from the EpiServer project template, the libraries had automatically been added to the bin folder also. When he updated the references to point to the lib folder, copy local defaulted to false. This still worked on his machine due to the original copies placed in the bin folder by the template. Updating them to CopyLocal = True fixed the issue.

user6535
  • 89
  • 2
1

I just had this same problem, again with an EPiServer site. It was because I was referencing the EPiServer DLLs, but they did not have the "copy to local" property set to true on all the references, and so they were not all being placed in the bin directory.

Paul Houghton
  • 491
  • 3
  • 9
1

Delete everything from BIN Folder and copy all the files from [ASSEMBLIES] in to BIN Folder fixed the problem for me.

Khizer Jalal

-2

I guess the original error message meant you had a malformed C# expression in

return ((EPiServer.Personalization.SubscriptionInfo, EPiServer)...

nothing to do with the config file.

Probably you typed "," instead of "." ? (As the compiler reads this, you provide 2 types in the cast)

Revert web.config to its original version and fix the typo, that should work.

update after Greg's comment:

I didn't realize the config section you posted were part of the EPIServer configuration. You were right then to remove the assembly names.

However I guess you need to reference the EPiServer from the web app (Add Reference...). I think I noticed this in my projects too: If you checkout an ASP.Net app to a new location, you need to add all references again.

devio
  • 36,858
  • 7
  • 80
  • 143
  • 1
    Hi devio, The return statement is in an auto generated .cs file. I'll update my question to reflect this – Greg B Jul 02 '09 at 09:02