After looking all over the net I found this. It is for Windows Vista, but it does work for the Windows 8 also.
Basically Service account doesn't have enough power to look at the processor and memory. So if you type the following command in a CMD in Administrator mode you can fix this issue.
Step 1 - Press the "Windows" key.
Step 2 - Type "cmd"
Step 3 - Right Click or Long press on the "cmd" application.
Step 4 - On the bottom of the screen you should see "Run as administrator"
Step 5 - On the new command line type in
Net localgroup Administrators Service /add
Step 6 - Restart the machine.
Step 7 - It should be all OK.
Thursday, May 30, 2013
Thursday, May 23, 2013
Checking if a DLL is 32bits.
So I was trying to deploy a web service in IIS, but I was getting the following error when I tried to access the service using IE.
"Could not load file or assembly 'myAssembly.name' or one of its dependencies. An attempt was made to load a program with an incorrect format body..."
I had seen this before. My file was inside IIS, so I knew the file was there, so one question remained. I am running pure 64bits, could this dll be compiled in 32bits only? I made the following test.
I went to IIS's "Application Polls" and found my service:
Then I changed the "Enable 32-Bit Applications from FALSE to TRUE.
"Could not load file or assembly 'myAssembly.name' or one of its dependencies. An attempt was made to load a program with an incorrect format body..."
I had seen this before. My file was inside IIS, so I knew the file was there, so one question remained. I am running pure 64bits, could this dll be compiled in 32bits only? I made the following test.
I went to IIS's "Application Polls" and found my service:
Then I changed the "Enable 32-Bit Applications from FALSE to TRUE.
And the amazing thing is that my service returned XML when I hit it with IIS.
Crap my DLL was really 32bits. But how to really check?
Here comes CorFlags:
By just finding the DLL using command line program for VS2010 (Visual Studio Command Prompt (2010). I normally search for "Prompt" and the program will display.
By running:
CorFlags myLibrary.DLL
The following showed up:
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 11
ILONLY : 1
32BIT : 1
Signed : 1
Just for kicks I ran on another library that I knew was 64bits:
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.
Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 9
ILONLY : 1
32BIT : 0
Signed : 1
So I need to go back to my compiler and make sure to compile in 64bits and try again.
God bless,
Bruno
Thursday, April 11, 2013
Microsoft Unity IsRegister is for Debug only
This blog entry is based on this forum discussion, and of course my horrible experience with this.
So here was my code idea.
1 - Start off with an empty container.
2 - Whenever a Interface was asked to be resolved I would look on my current registered interfaces (aka using IsRegistered)
3 - If implementation was found just resolve it.
4 - If implementation was NOT found start looking on current directory for assemblies built by me (my assemblies would start with the company name)
5 - Load assembly and look for classes that implemented the interface I was looking for.
6 - If a specific name of a class was not given I would return the first class that implemented the interface asked.
Great code right? Not really, when running on a multi-threaded system I would get the follow error:
Exception:System.Exception: Collection was modified; enumeration operation may not execute.
So I started looking around and found the article mentioned above. Someone on the thread mentions that IsRegistered should only be used for Debug purpose. And it is NOT thread safe :(
Here is the code posted:
The LINQ in there was my issue.
So I resorted to trying to do the register and if throw exception I catch and do my search.
try
{
newItem = _container.Resolve(interfaceType);
}
catch (ResolutionFailedException)
{
/// handle it here.
Have fun!
So here was my code idea.
1 - Start off with an empty container.
2 - Whenever a Interface was asked to be resolved I would look on my current registered interfaces (aka using IsRegistered)
3 - If implementation was found just resolve it.
4 - If implementation was NOT found start looking on current directory for assemblies built by me (my assemblies would start with the company name)
5 - Load assembly and look for classes that implemented the interface I was looking for.
6 - If a specific name of a class was not given I would return the first class that implemented the interface asked.
Great code right? Not really, when running on a multi-threaded system I would get the follow error:
Exception:System.Exception: Collection was modified; enumeration operation may not execute.
So I started looking around and found the article mentioned above. Someone on the thread mentions that IsRegistered should only be used for Debug purpose. And it is NOT thread safe :(
Here is the code posted:
public static bool IsRegistered(this IUnityContainer container, Type typeToCheck, string nameToCheck) { Guard.ArgumentNotNull(container, "container"); Guard.ArgumentNotNull(typeToCheck, "typeToCheck"); var registration = from r in container.Registrations where r.RegisteredType == typeToCheck && r.Name == nameToCheck select r; return registration.FirstOrDefault() != null; }
The LINQ in there was my issue.
So I resorted to trying to do the register and if throw exception I catch and do my search.
try
{
newItem = _container.Resolve(interfaceType);
}
catch (ResolutionFailedException)
{
/// handle it here.
Have fun!
Wednesday, March 20, 2013
ASP.Net (Telerik Controls) page buttons do not respond.
Opportunity:
I had the following page:
The controls in green worked fine and responded to the Calendar event and the Time event, but the buttons in read never went to the code behind.Looking at the debug information on the Console in Chrome I would get an error with "INVALID JSON PRIMITIVE". Looking on the web gave me no answer.
I moved the End Date with the Start Date controls and the End Date started working, but the Start Date would stop. So it was positional.
Solution:
After much time wasted I found the following line of XMAL in the aspx page that was enclosing all the controls:
<telerik:RadPanelBar runat="server" ID="RadPanelBar1" Width="851px" Skin="Office2007" ClientIDMode="Static" OnClientItemCollapse="PanelCollapse" OnClientItemExpand="PanelExpand">
<!-- My controls were all in here -->
</telerik:RadPanelBar>
Finally after going back and forth between another page that worked God blessed me with the answer. The ClientIDMode="Static" was the problem.
Explanation:
The root cause was that all my controls ended up having the same ID, so it could not differentiate between the controls and only the first control in the list would work.
That was 1 day worth of working trying to debug this.
Tuesday, February 26, 2013
How to install ASP.Net on your windows machine.
I get sometimes the ASP.NET Not Installed
I just need to run the following command:
I just need to run the following command:
\WINDOWS\Microsoft.NET\Framework\<version>\aspnet_regiis -i
Tuesday, February 12, 2013
Getting to see the GAC files
This information comes form this entry.
Inside Visual Studio when I looked at one of my references it was stored in a folder named:
C:\Windows\Assembly\GAC_MSIL\...
But when I tried to navigate to such folder I could not reach it. It told me it does not exist.
Manually navigating to the folder made me even more puzzled. The C:\Windows\Assembly had no folders.
As it turned out I was looking at it using the "CacheViewer" which seems pretty useless. Specially that I could not copy anything out of it, and had no Right-Click actions.
I did the following to correct the issue with the help of the article mentioned above:
1 - Opened my Run command (Windows Key + R)
2 - Typed 'regedit' (without the quotes)
3 - Pressed enter
4 - Navigated to HKEY_LOCAL_MACHINE\Software\Microsoft\Fusion
5 - Looked for "DisableCacheViewer"
7 - On the new field type in 'DisableCacheViewer'
8 - Double-Click on the entry and type a 1 on the 'Value data:' field
9 - You should be able to go to the C:\Windows\Assembly and see the GAC folders.
Inside Visual Studio when I looked at one of my references it was stored in a folder named:
C:\Windows\Assembly\GAC_MSIL\...
But when I tried to navigate to such folder I could not reach it. It told me it does not exist.
Manually navigating to the folder made me even more puzzled. The C:\Windows\Assembly had no folders.
As it turned out I was looking at it using the "CacheViewer" which seems pretty useless. Specially that I could not copy anything out of it, and had no Right-Click actions.
I did the following to correct the issue with the help of the article mentioned above:
1 - Opened my Run command (Windows Key + R)
2 - Typed 'regedit' (without the quotes)
3 - Pressed enter
4 - Navigated to HKEY_LOCAL_MACHINE\Software\Microsoft\Fusion
5 - Looked for "DisableCacheViewer"
6 - If one is not found right-click on the right pane and select 'New -> DWORD (32-bit) value'
7 - On the new field type in 'DisableCacheViewer'
8 - Double-Click on the entry and type a 1 on the 'Value data:' field
9 - You should be able to go to the C:\Windows\Assembly and see the GAC folders.
God bless,
Bruno
Monday, February 11, 2013
Things to remember when doing replication. Microsoft SQL Server 2008 R2
1 - Remember to have the "Snapshot Agent" running.
A - Right click on the Publication
B - Select "View Snapshot Agent Status"
C - If not running find out why. In my case the service did not have rights to write to a folder, made sure the service did have rights.
D - Restarted the agent.
2 - Have a substitution to test the Publication.
A - Right click on the Publication
B - Select "View Snapshot Agent Status"
C - If not running find out why. In my case the service did not have rights to write to a folder, made sure the service did have rights.
D - Restarted the agent.
2 - Have a substitution to test the Publication.
Subscribe to:
Posts (Atom)
Kitematic - Self Signed Certificate In Certificate Chain
Found this issue while behind a enterprise proxy. Proxy uses self signed certificate. Windows has the certificate as trusted, docker works f...

-
Found this solution at the MSDN KB (KB2608523). Create a batch file with the following contents, or just run one line at a time on your co...
-
I needed to run a certain code only when the browser was IE. So I needed a way to check for browser, and here is the line of code: if (str...
-
I have been working with this solution I have 4 projects: - Project to hold the xaml files - Project to hold the first level library (cont...