|
Ok got a big problem. I have a brand new machine..i.e I rebuilt it and now I want to run a web project that references some C++ assemblies and some C# assemblies. I have done everything by the book but I keep getting the same error:
Parser Error Message: File or assembly name Core.Data.TM1, or one of its dependencies, was not found.
With the trace as follows:
=== Pre-bind state information ===
LOG: DisplayName = Core.Data.TM1
(Partial)
LOG: Appbase = file:///c:/inetpub/wwwroot/TMJTester
LOG: Initial PrivatePath = bin
Calling assembly : (Unknown).
===
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Core.Data.TM1
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/tmjtester/51fb5434/c4dfe5c7/Core.Data.TM1.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/tmjtester/51fb5434/c4dfe5c7/Core.Data.TM1/Core.Data.TM1.DLL.
LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/TMJTester/bin/Core.Data.TM1.DLL.
LOG: Publisher policy file is not found.
LOG: No redirect found in host configuration file (C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet.config).
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config\machine.config.
LOG: Post-policy reference: Core.Data.TM1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=4c3e63d723dc8458
___________________________________________________________
this seems like it is a circular reference issue...cannot be sure though. Any suggestions on how to figure out where the problem might be ?
Thanks
Sameer
|
|
|
|
|
sameer handa wrote:
I have done everything by the book but I keep getting the same error
And what book is that? Make sure that your assemblies are strongly named, and it's best to intall them into the GAC. There are known problems with using signed files in the private path (bin sub-directory by default for ASP.NET). The .NET service pack documentation claims this is by design, however.
If you need additional help, please be specific about how you have set up your ASP.NET Web Application. I.e., where are your assemblies (remember that the PATH environment variable matters not) and are they strongly named?
The fusion log above just states that an assembly cannot be found so it is searching for redirects and in common locations. All that means is that the assembly cannot be found.
Believe - when developed and deployed correctly (i.e., typically into the GAC) .NET assemblies do end DLL hell. I recommend you read the section How the Runtime Locates Assemblies[^] in the .NET Framework SDK - the only "book" I ever follow.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks in part to your verbal smackdown I was inspired to read the SDK last night. Sometimes...reading the big C# book is not the same as reading the SDK.
Anyway I think I am close to finding the problem.....The problem is that in the Temporary ASP.NET Files directory there is a file being created called
__AssemblyInfo__.ini which has "wrong" information i.e it has the wrong
PublicKeyToken=4c3e63d723dc8458. Not quite sure where it is getting this information and I say this simply because it is my 3rd day here and I am not that familar with the code and set up yet.
So if yuo have any ideas on where I could start may be good.
|
|
|
|
|
I'm sorry you view it as a "verbal smackdown" - it wasn't intended as such.
Make sure the correct assembly is installed into the GAC. If your putting signed assemblies into the bin sub-directory (it works, but you may have problems when the AppDomain is recreated due to changes in the web application). This is done for you automatically if you add references to other assemblies (besides those already in the GAC, or those with "Copy Local" set to "True") or projects in your solution.
I also recommend you shutdown the web site(s), clear the Temporary ASP.NET Files" directory, and restart the web site(s). This should recreate all information once you have everything in place correctly as I described above.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I have 2 questions, and answering either will easily solve a problem.
The first, where might I find the lovely bitmaps and such that Microsoft uses in their operating system so that I can use these same ones in my application? Particularly, the arrow button that you see at the ends of slider bars and combo boxes.
~OR~
If I have a combobox with nothing in its list, and I click the dropdown button, how can I prevent the list from showing one blank line?
Either answer will help! Thanks a bunch.
- D
|
|
|
|
|
See the ControlPaint.DrawComboButton method in the .NET Framework SDK for one option. Otherwise, you'll need to include bitmaps yourself, either embedding them into a ResX file (using an ImageList in the designer does this for you, which base64-encodes it) or embed them as manifest resources by adding them to your project and changing the build action to "Embedded Resource". You can access these bitmaps (which I use generically for pixel map images) using Assembly.GetManifestResourceStream or some methods on the Image and Bitmap classes allow you to specify a manifest resource from which an Image or Bitmap (derivative of Image ) is created.
It's important to understand that most of the Windows Forms controls are not implement in .NET, per se. They encapsulate the Windows Common Controls, so it's the native window classes that are being used and which take care of drawing themselves (for the most part).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I like the ControlPaint.DrawComboButton method, however, why doesn't the OnPaint handler fire in a class inherited from a TextBox?
If I change the base class to Label, or another control, the OnPaint handler fires, but not with TextBox...any ideas?
|
|
|
|
|
It's not supposed to fire. As I've tried to remind those in this forum many times, most of the Windows Forms controls encapsulate the Windows Common Controls. The TextBox encapsulates (wraps) the Edit control, which paints itself and cannot be overridden as many other controls can (like the Static class, which is encapsulated in the Label class). Even the ListView doesn't work the same with the call to OnPaint . In order to custom draw items, you have to handle the right notification messages.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Has anyone experienced a problem with SHDocVw in C# where the events don't fire? This problem seems to be random as on some computers they do fire and some they don’t.
I'm not trying to use create a browser control, so I’m not using axSHDocVw.
What I’m trying to do is automate tasks between 2 IE windows e.g. cut & paste.
Any help would be appreciated.
Thanks
|
|
|
|
|
|
Thanks for the ref to that article.
How do you create a generic handler for the SHDocVw.InternetExplorer?
|
|
|
|
|
|
Not through the BCL, no. You can P/Invoke InternetGetCookie :
[DllImport("wininet.dll", CharSet=CharSet.Auto)]
private static extern bool InternetGetCookie(
string url,
string cookieName,
[Out] string cookieData,
ref int dataSize); That third parameter should not use out , mind you - it should be marshaled as an [out] param using the OutAttribute only, otherwise the CLR will crash. See the Platform SDK for usage, but it's really pretty easy to do. To easily allocate a string of a certain size, you can use new string('\0', size) or declare those as StringBuilder s and modify your source accordingly.
Then you can parse and include these in your CookieContainer for use with the HttpWebRequest .
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I was wondering if there is way for me to set current input language using C# (not Windows settings)... for instance whenever user focues my form I want to set current language to, let's say Spanish.
Anyone can help?
And... yes; I presume that languages are installed but it would be good if in response would be included a hint to where can I see how to detect currently installed languages on computer and do little validation.
Tnx
|
|
|
|
|
Here is some sample (vb, sorry) code that switches to a new language, and then back again when done. The new language is stored in the string variable currentLanguage
Dim oldCulture As System.Globalization.CultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture
Try
System.Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo(currentLanguage)
...do stuff...
Finally
System.Threading.Thread.CurrentThread.CurrentCulture = oldCulture
End Try
my blog
|
|
|
|
|
Hey,
I've built a small email application(I use the System.Web.Mail namespace), when I send the email/emails with attachments they work very well, my network technician says its works pretty well, expect that there is no disconnect, my program simple just shuts down. I was wondering if there isnt any way to tell the server that we are quiting and done sending. It seems I dont send any quit command so that the smtp server releases my connection.
Some of the code:
SmtpMail.SmtpServer = "myMailserver.com";<br />
<br />
MailMessage mail = new MailMessage();<br />
mail.To = this.smtpTo.Text;<br />
mail.Cc = this.stmpCC.Text;<br />
mail.Bcc = this.stmpBCC.Text;<br />
mail.From = this.smtpFrom.Text;<br />
mail.Subject = this.stmpSubject.Text;<br />
mail.Body = this.MessageBox.Text;<br />
MailAttachment attachment = new MailAttachment(AttachmentBox.Text);<br />
mail.Attachments.Add(attachment);<br />
SmtpMail.Send(mail);
Best Regards
/Johan
|
|
|
|
|
SMTP functionality is provided by CDO on Windows (installed with the Virtual SMTP Server, Microsoft Exchange, and - IIRC - Outlook) and works however the CDO client libraries work.
Roll your SMTP client. It's really quite easy. See RFC 821 at http://www.ietf.org/rfc/rfc0821.txt[^]. There should also be some examples here on CodeProject, as well as threads in this forum (click "Search comments" above to search this forum) - I know I've discussed this before.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I am compiling a .CHM file with Help & Manual 3.0. I have several fields labeled as popup type. These are outputed into an internal text file titled CSHelp.txt. I need to know how to access this text to display as a popup when F1 is pressed on a control. I see that you can access the internal html of the chm file by using html\yourfile.htm in HelpKeyword field. I assume there is an internal type string that I can use to access the popups. I am using the HelpProvider interface in the designer. Thanks in advance.
|
|
|
|
|
You can access the txt file in the same way: mychm.chm::/CSHelp.txt. How this text is parsed into your application depends on how it's stored. Any file compiled into the CHM is accessible via a URL.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello everybody!
First I´m sorry about my english, I come from germany.
I have a little obscure problem with reflection.
I created a own class with only one constructor ->
private static System.Reflection.Assembly assembly;
public MyReflection(string dllfilename)
{
assembly = System.Reflection.Assembly.LoadFrom(dllfilename); //**
// do something with assembly (this part works fine!)
}
In my main application I´m creating an object from this class like:
MyReflection myRefl = new MyReflection(dllfilename);
I choosed that a user can change the assembly file (for example to actualize it) in my main application and the code line "MyReflection ... = new ..." is recalled with the different dllfilename.
If I debug MyReflection class it is working fine until the line signed with //**.
I can recrate the object how many times I want, but it keeps the first assembly file. Why?
Why doesn´t actualize my computer this file (the string "dllfilename" is always appearing correctly!)
Is it a problem with the garbage collector? And if this is true, how can I definetely force that C# destroys an object?
It would be nice if someone is answering to me..
Ciao
Norman-Timo
|
|
|
|
|
Are you trying to load a different version of the same assembly? If so, if you havn't strong named the assmebly the CLR class loader will disregard the version number of the assembly. To perform this operation safely so you don't have to deal with file locking, take a look at AppDomain.ShadowCopyFiles as this is implemented by fusion and also used in ASP.NET. At least load the assembly into it's own AppDomain which will allow you to safely unload the AppDomain when you are done with the assembly.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hello,
I am new to .Net and wanted to know if dot Net has a somethig similar to or API for creating and managing Compound documents. Actually i want to port an application that makes extensive use of Compound Files to .Net. So is there any equivalent of Compound Files in .Net ???
Omar Alvi
|
|
|
|
|
As in compound documents that implement COM interfaces? No. You have to declare the necessary COM interfaces with the proper GUIDs (using the GuidAttribute ) and declare them as IUnknown , IDispatch , or dual interfaces using the InterfaceTypeAttribute . Make sure the methods and properties are in the same VTBL order for IUnknown and dual interfaces, and that you use the DispIdAttribute to declare the proper DISPID for IDispatch and dual interfaces.
A couple are already defined in System.Runtime.InteropServices , such as UCOMIPersistFile , but other interfaces like IPersistStream are not.
If you mean "compound documents" are self-serializing documents, then you can use runtime serialization. See Serializing Objects[^] in the .NET Framework SDK for more information and examples. These types of files are not like COM compound documents, however.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I would like to have dynamic help feature in my application as we can see in .net framework.
I would appreciate any links & help.
Ravindra
|
|
|
|
|
You should start by reading the documentation for the help classes provided in the .NET BCL (base class library):For information on how to create HTML Help files (CHMs), I recommend you do a search on "HTML Help" using google or something. There's a lot of information about HTML Help on the web.
Microsoft MVP, Visual C#
My Articles
|
|
|
|