Error in deploy project

W

WT

WTCRM.Settings.DBDataStore is a class in a main site deployed including
everything in the same assmebly

Address_Manager project is an external module that uses WTCRM as a
reference.
Address_Manager contains classes derived from DBDataStore.
The deploy project for AddressManager is trying to load DBDataStore from its
own App_Code assembly and not from WTCRM, and I get error:

Error 1 Could not load type 'WTCRM.Settings.DBDataStore' from assembly
'App_Code, Version=1.0.0.37368, Culture=neutral, PublicKeyToken=null'.
ASPNETCOMPILER 1 1 AddressManager_deploy


seems like a bug no ?

CS
 
S

Steven Cheng[MSFT]

Hi CS,

Thank you for posting.

From your description, you've developed an ASP.NET 2.0 web application
which references and uses some external assemblies. However, after you
precompiled the web application and try running it, you're getting "could
not load type..." exception on a certain type, correct?

As for the precompilation on the application, are you using the
WebDeployment Project? Also, based on the class/library info you mentioned,
it seems that the external library(also referenced by your web
application?) also reference a certain class in your web application? If
this is the case, I'm afraid this could cause error behavior. As for our
ASP.NET web application, all the types get compiled in this project should
not be referenced by other external library, at least a web project(or
winform project) is not good one for defining reusable types. If there is
such types in your web application, I would recommend you separate them
into external class library project and reference them in your web project.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
W

WT

Hello Steven,
Thanks for answer, my comments under your text
Steven Cheng said:
Hi CS,

Thank you for posting.

From your description, you've developed an ASP.NET 2.0 web application
which references and uses some external assemblies. However, after you
precompiled the web application and try running it, you're getting "could
not load type..." exception on a certain type, correct?

No that's not the schema:

I have a web site , lets name it WTCRM, this web site is made using the
webdeployment project with option
"Merge all pages and controls into a single assembly", name is WTCRM.dll

Now I want to create a loadable module, just like Dotnetnuke or rainbow
modules.
This kind of module uses a reference from the WTCRM.dll to inherit from
classes it contains.
The process was very easy in .net 1.1.

It is when I try to 'webdeploy' my module that I get the error message, not
in run time, in 'deploy time'.
the deploy process is searchin in the module App_Code for a base class
where it should look in the WTCRM.dll.

As for the precompilation on the application, are you using the
WebDeployment Project? Also, based on the class/library info you
mentioned,
it seems that the external library(also referenced by your web
application?) also reference a certain class in your web application? If
this is the case,

This is not the case, schema is:
WTCRM.dll contains class A
module contains class B which inherits from A
this is working for all .net System.xxx namespaces, why not there ?
and again it was working in 1.1
such types in your web application, I would recommend you separate them
into external class library project and reference them in your web
project.

My main assembly, the core engine, would be jeopardized in many assemblies:
not easy when you want to sell a product.
My question is now: how to do with .NET 2 what 1.1 was doing easily without
problems ???

Thanks for your suggestions and time
CS
 
S

Steven Cheng[MSFT]

Thanks for your response CS,

So I've got that you actually first use web deployment project to
precompile the ASP.NET 2.0 web application(into single assembly) ----
WTCRM.dll. Then creating another reusable module which reference the
WTCRM.dll. I'm afraid this is the potential cause since webdeployment
project did help us generate a single precompiled assembly for ASP.NET 2.0
project, however, the generated assembly contains all the classes which is
finally used by the ASP.NET runtime to avoid additional dynamic
compilation. Such precompiled assembly is certainly not recommended to be
used as other module or application's reference... Would you consider
pre-separate such class(in the web application) which may be further
referenced by other module into a class library project?

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
W

WT

I will take a look to this approach, but it will not be easy. In fact I just
need classes that are in the App_Code of WTCRM. If I would separate
something in different assemblies, it would be App_Code....
Sorry to repeat but this was working easilly in 1.1

CS
 
S

Steven Cheng[MSFT]

Thanks for your response CS,

Yes, I understood your pain on this. However, I would still recommend you
try your best to change the project or solution's class isolation strategy
according to the new ASP.NET 2.0 compilation model.

Regards,

Steven Cheng
Microsoft Online Community Support


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,123
Latest member
Layne6498
Top