Can I run ASP.NET app from different virtual site?

G

Guest

Hi

I have a ASP.NET 1.1 app that is compiled to say "APP1.dll" and APP1 is the name of the virtual directory. I want to be able to have a staging site where I can just copy the files over to another virtual directory called APP2. When I first tried it I got Resource Manager errors. I tried just renaming the main dll and resource file dll's to APP2 and then got "Comparing the assembly name resulted in the mismatch: NAME" error. If the files run in the same virtual directory name that they were compiled under, everything is fine. What's the correct way to do this

Thanks
Chris
 
J

John Saunders

Chris said:
Hi,

I have a ASP.NET 1.1 app that is compiled to say "APP1.dll" and APP1 is
the name of the virtual directory. I want to be able to have a staging site
where I can just copy the files over to another virtual directory called
APP2. When I first tried it I got Resource Manager errors. I tried just
renaming the main dll and resource file dll's to APP2 and then got
"Comparing the assembly name resulted in the mismatch: NAME" error. If the
files run in the same virtual directory name that they were compiled under,
everything is fine. What's the correct way to do this?

I do this all the time, with no resource manager problems. Try again, from
scratch, and tell us what resource manager problems you're having.
 
C

Chris Strobel

Hi John,

I get:

[ArgumentException: ResourceManager base name should not end in
resources. It should be similar to MyResources, which the
ResourceManager can convert into MyResources.<culture>.resources; for
example, MyResources.en-US.resources.]
System.Resources.ResourceManager.CommonSatelliteAssemblyInit() +195
System.Resources.ResourceManager..ctor(String baseName, Assembly
assembly) +55
SupplierLink.UtilityBiz..ctor() +78
SupplierLink.Login..ctor() +100
_ASP.Login_aspx..ctor() +6

I have a default resource file which is compile into the main dll and I
have 2 Satellite dlls for Japanese and Spanish. It all works fine when
it's under the same site name as it was developed under. Should I be
able to just use the same files on the the same server but under a
different virtual directory. It looks like this:

IIS
APP1
bin
APP1.dll
es
APP1.resources.dll
ja
APP1.resources.dll

New site that gets errors:

IIS
APP2
Bin
APP1.dll
es
APP1.resources.dll
ja
APP1.resources.dll

The virtual site name is the only difference. It's the same files just
copied to a different directory and with a different virtual site name.
Should I be able to do this?

I'm using Code-Behind pages and it's not strongly named and haven't done
anything with the GAC...

Thanks,
Chris
 
J

John Saunders

Chris Strobel said:
Hi John,

I get:

[ArgumentException: ResourceManager base name should not end in
resources. It should be similar to MyResources, which the
ResourceManager can convert into MyResources.<culture>.resources; for
example, MyResources.en-US.resources.]
System.Resources.ResourceManager.CommonSatelliteAssemblyInit() +195
System.Resources.ResourceManager..ctor(String baseName, Assembly
assembly) +55
SupplierLink.UtilityBiz..ctor() +78
SupplierLink.Login..ctor() +100
_ASP.Login_aspx..ctor() +6


Ok, so maybe the SupplierLink.UtilityBiz constructor is instantiating a
ResourceManager and specifying something for the baseName parameter which
ends in ".resource"? In that case, "don't do that".
 
G

Guest

I think I have it figured out. Is there a way to instantiate the Resource Manager without having to name the assembly? I was doing it like this:

Private mobjResourceManager As ResourceManager = New ResourceManager("APP1.Resources", GetType(Header).Assembly)

I get errors if I don't include the APP1. In some examples I've seen they just have the name of the Resource which is "Resources.resx". I was trying to share the same class file in 2 different projects which gets compiled into each project.

I can do something like this:

Private mobjResourceManager As ResourceManager = New ResourceManager(Reflection.Assembly.GetExecutingAssembly.GetName.Name & ".Resources", GetType(Header).Assembly)

and that will make it work, but it seems like I shouldn't have to from other examples.

Thanks,
Chris
 
J

John Saunders

Didn't the error message say you should _not_ use the .resources extension?

--
John


Chris said:
I think I have it figured out. Is there a way to instantiate the Resource
Manager without having to name the assembly? I was doing it like this:
Private mobjResourceManager As ResourceManager = New
ResourceManager("APP1.Resources", GetType(Header).Assembly)
I get errors if I don't include the APP1. In some examples I've seen they
just have the name of the Resource which is "Resources.resx". I was trying
to share the same class file in 2 different projects which gets compiled
into each project.
I can do something like this:

Private mobjResourceManager As ResourceManager = New
ResourceManager(Reflection.Assembly.GetExecutingAssembly.GetName.Name &
".Resources", GetType(Header).Assembly)
 
C

Chris Strobel

I tried renaming them to something different and I still got the error.
When you instantiate the ResourceManager are you using just the name of
the resource files or do you put in the AssemblyName.Resources?
 
J

John Saunders

Chris Strobel said:
I tried renaming them to something different and I still got the error.
When you instantiate the ResourceManager are you using just the name of
the resource files or do you put in the AssemblyName.Resources?

I don't use this method.

Just try it without the ".resources" extension and see what happens.
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top