Showing posts with label NET Framework. Show all posts
Showing posts with label NET Framework. Show all posts

Wednesday, June 11, 2008

Fixing the: System.InvalidOperationException: Unable to generate a temporary class : Error

More testing on our new Application Server and I encountered the error

System.InvalidOperationException: Unable to generate a temporary class(result=1). error CS2001: Source file ...

Unfortunately Microsoft offers this advice:
"To avoid this problem, give read/write priviledges for the Temp folder to the ASPNET account"

While technically correct, this treating the symtom instead of the root cause.
Chances are if the ASPNET account does not have one permission it needs, then there are other permission missing. These accounts and permissions are usually missing because IIS is installed after the Dot Net Framework.

When the Framework is installed after IIS, it detects the existence of IIS and configures the appropriate accounts.

To do this manually you need to run the following command:
aspnet_regiis.exe -i

This registers aspnet with IIS. The side effect is all the appropriate account are created.

Tuesday, June 10, 2008

Fixing the: The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to error

Doing some testing of our website on a new server.

Encountered the following error when testing a web service:

"The current identity (NT AUTHORITY\NETWORK SERVICE) does not have write access to "

The fix for this is pretty simple run the following command:
aspnet_regiis -ga "NT AUTHORITY\NETWORK SERVICE"

If this command is not recognized at the command line you will need to find aspnet_regiis, for the 2.0 Framework it is usually in the following path:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

Wednesday, May 21, 2008

Retrieving GPS data from Sprint Aircard

The dot Net Framework has so much in it that it is more likely to have something than not.

I remember browsing over the "System.IO" namespace and being amused that it had:
"System.IO.Ports.SerialPort"

Thinking that my serial communication programming days were long over, I chuckled and moved on.

So I was surprised to find that the Sprint Aircards that we are using to stream video from Police Crusisers to the world, are exposing the GPS data continuously on com port. A little bit surprising because the connection is a USB port. So thanks to the dot Net Framework, I just have to write 16 lines of code and I now have location data.

Now looking for killer app here, I can pass this location information to MS Live Maps along with the donut parameter and I can bring up a map showing the police officers location together with nearest donut shops.