Showing posts with label Workarounds. Show all posts
Showing posts with label Workarounds. Show all posts

January 18, 2016

AccessViolationException when using Font from PrivateFontCollection

Issue:

You have used a PrivateFontCollection to get access to a Font and are using it when suddenly you get an AccessViolationException while using the font.

Cause:

The PrivateFontCollection object has gone out of scope and has been disposed.  When the object goes out of scope, it seems to destroy any Font object that came from it.

Solution:

Move the declaration of the PrivateFontCollection so that it stays in scope until you are done with all fonts that you are using from it.

January 24, 2015

Helper - Convert FPS Creator Models for Leadwerks Using Ultimate Unwrap 3D Pro

Just a quick post tonight.

I found this wonderful tutorial by Jesse B. Anderson on how to convert FPS Creator Classic models to work with Leadwerks Engine 3.x.

I have a copy of Ultimate Unwrap3D Pro 32-bit, so I thought I'd try to automate the process since UU3D doesn't have a batch mode.

This is an extremely early copy of the code for my automation.  YOU WILL NEED TO MODIFY THIS CODE FOR YOUR OWN ENVIRONMENT. THIS CODE IS NOT VERY STABLE.  THERE'S STILL A LOT OF WORK TO BE DONE.

That said, this code is managing to successfully convert FPSC meshes and animated models over, as well as create animation key files for import into Leadwerks 3.3.  To use it, modify the paths that are going to be converted/converted to in the source, launch UU3D, and let it go.  If you run it through the debugger, you can usually hit "Continue" when Windows Automation freaks out and it will continue.

A later version is going to import the models into Leadwerks and properly scale the models, but this may be useful for some people as is.

May 7, 2014

Compile Against A Stub .JAR When Using Android Studio

Problem:

You are trying to compile against a stub .jar when using Android Studio.  When you compile and run the .apk on your device, you get a RuntimeException telling you to move the .jar to your classpath.

Cause:

You have the .jar set to compile.

Solution:

In Android Studio 0.5.7, go to File -> Project Structure.

Select your module.

Go to the "Dependencies" tab.

Find your stub .jar.

Click the down chevron next to "Compile" and change it to "Provided."

Rebuild.

May 1, 2010

WORKAROUND: Error Adding Web Service In VS2010

Symptom:
When adding a web service reference to a server behind a load balancer (for example, https://url converts to http://url:8081), you encounter an error similar to the following:

---------------------------
Microsoft Visual Studio
---------------------------
Metadata contains a reference that cannot be resolved: 'http://url:8081/WS/WebService.asmx?wsdl'.

There was an error downloading 'http://url:8081/WS/WebService.asmx?wsdl'.

Unable to connect to the remote server

A connection attempt failed because the connected party did not properly respo
---------------------------
OK
---------------------------

Workaround:
First, verify you can get to the WSDL by opening your web browser and pulling the WSDL manually.

If your web service is https://example.com/WebService.asmx, type in https://example.com/WebService.asmx?wsdl.

If you are able to retrieve the WSDL, do the following:

Right-click on your project.
Select "Add Web Reference."
Enter the address of the web service with ?wsdl at the end.
You will get about a dozen popups with this text: "Do you want to view only the webpage content that was delivered securely?" Say "No."
Add the web reference.

Now you have the web reference and the proxy class created, but you won't be able to execute the web service request. Two more steps are required.

Click the "Show all files" button at the top of the solution explorer and expand out your Web References tree. Inside your web reference, you'll find a .WSDL file and a file named "Reference.map."

Open the .wsdl file and find the wsdl:service area. Update the addresses listed there to be the true external name of the web service.

Open the reference.map file and also update the DiscoveryClientResult url field with the same value.

At this point, the web service will function.

December 12, 2008

WORKAROUND: ASP.NET "Response filter is not valid."

Problem:

ASP.NET 3.5 web site. You are trying to set the Response.Filter property and you are getting an HttpException with the message "Response filter is not valid."

Cause:

There is a bug in ASP.NET 3.5 where you cannot set the Response.Filter property unless you read it first. When the Response.Filter property is first read, it instantiates some internal fields in the HttpWriter class.

Workaround:

Just read the property first so that it initializes the internal properties accordingly.

In VB:
Dim f = Response.Filter ' Assumes Option Infer On
Response.Filter = New FilterStream(Response.OutputStream) ' Where FilterStream is your stream
In C#:
var f = Response.Filter;
Response.Filter = new FilterStream(Response.OutputStream);

December 5, 2008

Workaround: Ektron CMS400 7.5 Integrated Editing Breaks After Upgrade

Symptoms:

Your ASP.NET website is in a nested virtual folder underneath your Ektron CMS400 installation folder. For example, your Ektron 7.0 install folder is /CMS/ and your website is located at /CMS/Website/.

After upgrading to CMS400 7.5, integrated editing no longer works. You no longer get the green border or the white editing bubble.

Cause:

The session cookie for the CMS no longer matches the session cookie for the site.

Workaround:

Create a page on your site that contains three things. One, an IFRAME pointing to the login.aspx file in your Ektron CMS400 folder. Two, a button that calls in order in the code-behind the functions Session.Clear() and Session.Abandon() in that order. (I've tried them individually, but for some reason, it takes both of them for this to work in my testing environment.) Three, a link back to the home page of the site you want to edit.

Log into the CMS through your IFRAME.

After logging into the CMS, click the session kill button.

After clicking the session kill button, click the link back to the home page.

You'll have your editing environment back.

February 5, 2008

WORKAROUND: The value for the property "Settings Property Name" is not valid for the current language.

Symptoms: You are setting up your DBML file in Visual Studio 2008 so that you can use LINQ to SQL, and when you try to compile, you get the following error message:
The value for the property "Settings Property Name" is not valid for the current language.
Cause:You are using a named connection string and the key for that connection string has a period in it, like "Sql.Finance.ReadWrite."

Solution: Rename your connection string key to get rid of the periods, and nag Microsoft to fix this issue.