Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / January 2005

Tip: Looking for answers? Try searching our database.

Installing .NET 2.0 causes exception in .NET 1.1 code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Thielen - 19 Jan 2005 03:57 GMT
Hi;

I have a program built using .NET 1.1 that runs fine under .NET 1.1. It is a
Word Add-In written in C#.

However, if I install .NET 2.0 on a system, then I get an exception in my
code. The exception occurs where my C# code calls my J# code (the program is
composed of 2 projects, the C# project is 98% of the code and the J# project
is the other 2%).

I get the following:
System.TypeInitializationException: The type initializer for
'WindwardBear.utils.Cipher' threw an exception. --->
System.IO.FileNotFoundException: File or assembly name 'vjslib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', or one
of its dependencies was not found.

Any idea what is going on? I thought if I was using .NET 1.1 then .NET 2.0
had zero effect on my program???

Signature

thanks - dave

"Peter Huang" [MSFT] - 19 Jan 2005 07:26 GMT
Hi

Have you tried to use supportedruntime element in the app.config to use the
net 1.1 as the runtime? Because by default the application will use the
recently framework.

Also you may try to use the fuslogvw tool to monitor the binding process
when you run the program which will tell in which situation the binding
failed.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/htm
l/cpgrffusionlogviewerfuslogvwexe.asp

You may have a try.

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

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

David Thielen - 19 Jan 2005 14:09 GMT
Hello;

I can't use app.config because this is an Add-In for Word and I can't set
the word.exe.config because word is not my program.

Also, if just .net 2.0 is installed, then my Add-In won't run because it
wants .NET 1.1. So I don't think it is trying to use the .NET 2.0 framework -
is it?

I'll try the binding tool although based on the exception I am pretty sure
it's going to say it tried to bind to VSJ# and couldn't.

thanks - dave

> Hi
>
[quoted text clipped - 17 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 20 Jan 2005 03:00 GMT
Hi

I think to troubleshooting the problem, you may try to use the handle two
.net assembly load and resolved event.

In the OnConnection method, we can handle the two events and prompt the
current CLR version.(1.1 or 2.0)
            AppDomain.CurrentDomain.AssemblyResolve+=new
ResolveEventHandler(CurrentDomain_AssemblyResolve);
            AppDomain.CurrentDomain.AssemblyLoad+=new
AssemblyLoadEventHandler(CurrentDomain_AssemblyLoad);
            MessageBox.Show(System.Environment.Version.ToString());

//Those assembly is loaded failed and then we can load manually and return.
        private static Assembly CurrentDomain_AssemblyResolve(object sender,
ResolveEventArgs args)
        {
            //call return Assembly.Load("Assembly text name, Version, Culture,
PublicKeyToken", "MyType");
            Debug.WriteLine("CurrentDomain_AssemblyResolve " +args.Name);
            return null;
        }
//Those assembly that is loaded successfully.
        private static void CurrentDomain_AssemblyLoad(object sender,
AssemblyLoadEventArgs args)
        {
            Debug.WriteLine(args.LoadedAssembly);
        }

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

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

David Thielen - 20 Jan 2005 04:35 GMT
Hi;

Is there any way to get this debug output without running the program under
Visual Studio?

thanks - dave

> Hi
>
[quoted text clipped - 32 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 20 Jan 2005 05:47 GMT
Hi

There is tool named debug view which will capture the debug.writeline. Also
you can write the log into a file.
http://www.sysinternals.com/ntw2k/freeware/debugview.shtml

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

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

David Thielen - 20 Jan 2005 06:41 GMT
Hi;

I tried debugview - it didn't work. I'll try the write to a log file
approach. But I think something is very wrong for running a .NET 1.1 app that
uses J# when .NET 2.0 (but no VJ# 2.0) is installed.

thanks - dave

> Hi
>
[quoted text clipped - 9 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
David Thielen - 20 Jan 2005 07:05 GMT
Here it is:
----- with .NET 2.0 not installed -----

AutoTag assembly 1.1.4322.2032
AutoTag loaded Microsoft.Vbe.Interop, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c
AutoTag loaded System.Xml, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
AutoTag loaded vjslib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
AutoTag loaded vjscor, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
AutoTag loaded CustomMarshalers, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a

----- with .NET 2.0 installed -----

AutoTag assembly 2.0.40607.42
AutoTag loaded Microsoft.Vbe.Interop, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c
AutoTag loaded System.Xml, Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
AutoTag resolve vjslib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
AutoTag VSJ# exception Message The type initializer for
'WindwardBear.utils.Cipher' threw an exception.
AutoTag VSJ# exception ToString System.TypeInitializationException: The type
initializer for 'WindwardBear.utils.Cipher' threw an exception. --->
System.IO.FileNotFoundException: File or assembly name 'vjslib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a', or one
of its dependencies, was not found.
File name: 'vjslib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' ---> System.IO.FileNotFoundException: The
system cannot find the file specified.
  at WindwardBear.utils.Cipher..ctor(Int32[] map, Byte[] xor)
  at WindwardBear.utils.Cipher..cctor()

*** Assembly Binder Log Entry  (1/20/2005 @ 12:01:35 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  
C:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\mscorwks.dll
Running under executable  C:\Program Files\Microsoft
Office\OFFICE11\WINWORD.EXE
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = AURORA\dave
LOG: DisplayName = vjslib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Windward Studios/AutoTag/
LOG: Initial PrivatePath = NULL
Calling assembly : AutoTag2003, Version=3.1.1.0, Culture=neutral,
PublicKeyToken=267ad24bfdc007e1.
===
LOG: This bind is in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\config\machine.config.
LOG: Version redirect found in framework config: 1.0.5000.0 redirected to
2.0.3600.0.
LOG: Post-policy reference: vjslib, Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///C:/Program Files/Windward
Studios/AutoTag/vjslib.dll.
LOG: Attempting download of new URL file:///C:/Program Files/Windward
Studios/AutoTag/vjslib/vjslib.dll.
LOG: Attempting download of new URL file:///C:/Program Files/Windward
Studios/AutoTag/vjslib.exe.
LOG: Attempting download of new URL file:///C:/Program Files/Windward
Studios/AutoTag/vjslib/vjslib.exe.

  --- End of inner exception stack trace ---
  at WindwardBear.Framework.ReadRegistry()
AutoTag loaded CustomMarshalers, Version=2.0.3600.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a
"Peter Huang" [MSFT] - 21 Jan 2005 01:35 GMT
Hi Dave,

From the fuslogview, we will know that after install .net 2.0, the
winword.exe will run under the .net 2.0.
Since .net 2.0 is still in beta release, we did not recommend we use it in
our production environment, also for beta product we can post the problem
under the link below.
http://beta.microsoft.com

So far as a workaround, I think we can use the config file to tell winwork
to use .net 1.1.
<configuration>
  <startup>
     <supportedRuntime version="v1.1.4322"/>
  </startup>
</configuration>

BTW: you may try to install .net 2.0 J# lib to see if that works.

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

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

David Thielen - 21 Jan 2005 02:57 GMT
Hi;

I don't have a guest ID to get in to beta. Can someone let them know of this
issue or can I get a guest ID? (I do have a MSDN universal subscription.)

thanks - dave

> Hi Dave,
>
[quoted text clipped - 22 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" [MSFT] - 21 Jan 2005 03:36 GMT
Hi

We have a definitely newsgroup about Whidbey.
Welcome to the Microsoft Visual Studio 2005 Newsgroups
http://communities.microsoft.com/newsgroups/default.asp?icp=whidbey&slcid=us

For the beta.microsoft.com, here is I get from the page.

If you are interested in becoming a beta tester for a program, sign in with
your Microsoft .Net Passport account. When prompted, enter the GuestID
'BetaReq' and then go to the Potential Testers program.

We need a .NET Passport account you may check the link
http://www.passport.net and then use the GuestID 'BetaReq' to login.

Best regards,

Perter Huang
Microsoft Online Partner Support

Signature

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

David Thielen - 20 Jan 2005 05:55 GMT
Hi;

Here is some more possibly pertinent information. I finally got my Add-In to
run under Visual Studio on the test machine. But I can only do it if the .NET
2.0 runtime is not installed. If the .NET 2.0 runtime is installed - then as
soon as Word trys to load the Add-In, it exists. No exception of any kind -
it just exits.

Needless to say, this means I cannot get Debug.Writeln() statements when
.NET 2.0 is installed.

??? - thanks - dave

> Hi
>
[quoted text clipped - 32 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
David Thielen - 19 Jan 2005 16:09 GMT
I set both:
HKLM\Software\Microsoft\Fusion\ForceLog registry value to 1
and
HKLM\Software\Microsoft\Fusion\LogResourceBinds registry value to 1

then ran fuslogvw - nothing in it. Ran my program again, pressed refresh,
still no entries. Exited and restarted fuslogvw - still no entries.

The link you gave me says fuslogvw shows TypeLoadException errors and I am
getting a TypeInitializationException - so could it be that this dosen't show
in fuslogvw?

What do I do next?

thanks - dave

> Hi
>
[quoted text clipped - 17 lines]
> Get Secure! - www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
David Thielen - 20 Jan 2005 16:49 GMT
Hi all;

Ok, here's th scoop. You have to do a windword.exe.config (which you can't
depened on so you're screwed) telling it to use .NET 1.1. Then it works.
Otherwise it does not work if .NET 2.0 is loaded even though it is used .NET
1.1 for the Add-In.

- dave

> Hi;
>
[quoted text clipped - 15 lines]
> Any idea what is going on? I thought if I was using .NET 1.1 then .NET 2.0
> had zero effect on my program???

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.