Adding satellite assemblies to pre-compiled web applications

by lichen 9/28/2006 5:09:00 PM

In the following, we will provide step by step instructions are how to create the satellite assemblies and add them to precompiled ASP.NET application:

 

1)      Create resource files following the naming convention filename.locale.resx. The locale can be either the regular expression format [a-z]{2} for a language or [a-z]{2}-[A-Z]{2} for a dialect. For example, to create resource files for Simplified Chinese, we will copy the two resource files as SiteBuilderResources.zh-CN.resx and ManagerResources.zh-CN.resx and then translate them into Simplified Chinese.

2)      Compile and Link the resources files into the satellite assembly. Open the Visual Studio DOS command prompt and run the following commands:

 

resgen Resources.zh-CN.resx resources.zh-cn.resources

 

al /t:lib /embed:resources.zh-cn.resources /culture:zh-CN /out:App_GlobalResources.resources.dll

 

3)      Copy the App_GlobalResources.resources.dll into the bin\zh-CN directory under the root of the precompiled ASP.NET application.

 

Please also look at Ran Davidovitz's work: http://davidovitz.blogspot.com/2006/08/compiling-resource-file-in-precompiled.html

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | ASP.NET

For .Net to retrieve specific COM exception, COM must implement the ISupportErrorInfo interface

by lichen 9/28/2006 12:01:00 PM

Many COM objects simply use setErrorInfo and expect to call getErrorInfo to retrieve the detail error message. However, .Net would not call getErrorInfo unless the COM object implements the ISupportErrorInfo interface. There are the steps:

1. In the .h file, make the COM object implements the ISupportErrorInfo interface, e.g.:

class ATL_NO_VTABLE CMyObject : ..., public ISupportErrorInfo, ...

2. In COM MAP, add:

BEGIN_COM_MAP(CMyObject)

...

COM_INTERFACE_ENTRY(ISupportErrorInfo)

...

END_COM_MAP()

3. Add the method declaration:

// ISupportsErrorInfo

STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);

4. Implement the method in the .cpp file:

/////////////////////////////////////////////////////////////////////////////

// ISupportsErrorInfo

/////////////////////////////////////////////////////////////////////////////

//

STDMETHODIMP CMyObject::InterfaceSupportsErrorInfo(REFIID riid)

{

static const IID* arr[] =

{

&IID_IMyObject,

&IID_IMyObject2,

&IID_IMyObject3,

};

for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)

{

if (InlineIsEqualGUID(*arr[i],riid))

return S_OK;

}

return S_FALSE;

}

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net

Unable to access remote machine from asp.net applications running on Windows XP using IIS ADSI provider

by lichen 9/28/2006 11:43:00 AM

I have a asp.net application that configures asp.net applications running on remote machines using IIS ADSI provider. The applications works when the asp.net application runs on Windows 2003 but failed to access remote machines when it runs on Windows XP. After working with Microsoft support enginner, we found the reason:

1)       ADSI IIS Provider uses process token in additional to thread token.

2)       System and Network Service are special accounts. Domain Controller actually creates a hidden domain account that maps to these accounts. That is why System and Network Service accounts can access other machines but ASPNET cannot, unless the password for the ASPNET account is synchronized with the machine to access.

Base on the theory, I finally come out with a way that would work with Windows XP that is both simple and will not introduce any security risk. That is to run asp.net worker process under the Network service account. We could configure that with the following steps:

 

1)       In machine.config, change the userName in processModel to “NT AUTHORITY\NetworkService”

2)       Run the following command to setup the necessary privilege for the Network Service account:

 

Aspnet_regiis –ga “NT AUTHORITY\NetworkService”

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | ASP.NET

Guidance Explorer Web Edition

by lichen 9/28/2006 11:37:00 AM

I really like the web edition. The Desktop Edition updates every week and I just do no have time to download it every week.

http://www.guidancelibrary.com/guidanceexplorerbeta/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net

Tiny Url

by lichen 9/24/2006 5:28:00 PM
If the Url to your page is very long, you can use this service: http://tinyurl.com/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Code snippets

by lichen 9/24/2006 5:24:00 PM

Codes snippets for Visual Studio 2005:

http://www.GotCodeSnippets.com/

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net

A very good summary of the current state of Atlas as of Sept. 2006

by lichen 9/24/2006 12:52:00 PM

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Pages

    Recent comments

    Authors

    Tags

      Disclaimer

      The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

      © Copyright 2010

      Sign in