Print Page | Close Window

global.asax run-time compilation issue... (sometimes)

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2057
Printed Date: 21-Apr-2026 at 10:21pm


Topic: global.asax run-time compilation issue... (sometimes)
Posted By: ken.nelson
Subject: global.asax run-time compilation issue... (sometimes)
Date Posted: 10-Aug-2010 at 11:04am
Some background:
Currently, we copy the IdeaBlade assemblies for the current version of DevForce that we have installed (6.0.4) to a ReferenceAssemblies directory in our source repository, and reference those assemblies via the "Browse" tab in the "Add Reference..." dialog.  Now, I'm fully aware that it's a better practice to reference assemblies directly in the ".NET" tab of the "Add Reference..." dialog, and while that may fix the problem we're seeing it's not an ideal solution for us.  The reason we copy/browse is because not all our developers have DevForce installed, and when we branch our code, we prefer to have the exact 3rd party assemblies in the source control branch to avoid having to determine what version of 3rd party suites to install when performing maintenance on a previous version of our application (also helps during application deployment). 
 
That all said we're seeing some oddness that's been tricky to track down.  Some of our developers get the run-time compilation error below, others do not.  Basically there's 3 different scenarios. 
 
1) Developer that does not have any version of DevForce installed and application runs successfully.
2) Developer that has DevForce 6.0.4 installed and application runs successfully.
3) Developer that has DevForce 6.0.4 installed and application fails to run successfully due to the run-time error.
 
#3 is the crazy one.  Developer 1 and 2 prove that things are set up 'right', but for whatever reason, Developer 3 is unable to run the application.  To add to the weirdness, if Developer 3 uninstalls DevForce, everything runs ok!  If Developer 3 then reinstalls DevForce 6.0.4, things no longer work again.
 
Anyone have any ideas?
 
 
If it helps any, our Reference Properties:
 
 
And the XML in the .csproj file:
 
    <Reference Include="IdeaBlade.EntityModel, Version=6.0.4.0, Culture=neutral, PublicKeyToken=287b5094865421c0, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>..\Reference Assemblies\IdeaBlade\EFAssemblies\IdeaBlade.EntityModel.dll</HintPath>
    </Reference>
 
 
 

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0246: The type or namespace name 'IdeaBlade' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

 

Line 13:       // You do not need to supply .svc files for the EntityService and EntityServer services

Line 14:       // when the provider is registered.     

Line 15:       System.Web.Hosting.HostingEnvironment.RegisterVirtualPathProvider(new IdeaBlade.EntityModel.Web.ServiceVirtualPathProvider());    

Line 16:     }

Line 17:


Source File: c:\_source\AST\Current\Web \Global.asax    Line: 15

 

Microsoft (R) Visual C# 2010 Compiler version 4.0.30319.1

Copyright (C) Microsoft Corporation. All rights reserved.

 

c:\_source\AST\Current\Web\Global.asax(15,77): error CS0246: The type or namespace name 'IdeaBlade' could not be found (are you missing a using directive or an assembly reference?)

c:\_source\AST\Current\Web\Global.asax(28,3): error CS0012: The type 'IdeaBlade.EntityModel.EntityManager' is defined in an assembly that is not referenced. You must add a reference to assembly 'IdeaBlade.EntityModel, Version=6.0.4.0, Culture=neutral, PublicKeyToken=287b5094865421c0'.




Replies:
Posted By: kimj
Date Posted: 10-Aug-2010 at 7:07pm
This error looks like a "copy local" problem, i.e., the IdeaBlade.* assemblies should be located in the bin folder.  (The assemblies can instead be in the GAC, but you then need to list them in the web.config too.)
 
In the reference shown above for IdeaBlade.EntityModel, it does show "Copy Local = false".  Set all these references to "Copy Local = true" to ensure the assemblies are copied to the bin folder of the web application during a build.


Posted By: ken.nelson
Date Posted: 11-Aug-2010 at 7:49am
Thanks Kim, that fixed the issue.
 
That screenshot came from the Dev 3 scenario, with DevForce installed.  The really odd part is when Dev 3 uninstalls DevForce, the properties for that assembly reference automatically switches to Copy Local = true.  Reinstalled, it switches back to Copy Local = false.  Once I explicitly set Copy Local = true, Copy Local remains true forever.
 
Thanks!



Print Page | Close Window