I'm using the NReco FFMPegConverter, and when I try to get a thumbnail, I get the error:
System.ArgumentException: The path is not of a legal form.
at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.File.InternalGetLastWriteTimeUtc(String path, Boolean checkHost)
at NReco.VideoConverter.FFMpegConverter.EnsureFFMpegLibs()
at NReco.VideoConverter.FFMpegConverter.ExtractFFmpeg()
Here is the line of code where I'm getting my error.
var filep = domainVideoFile.AbsolutePath;
_fFMpegConverter.GetVideoThumbnail(filep, tempfileName);
In the above example, filep = "C:\Users\me_000\Downloads\GRoma\G.mp4"
and tempFileName = "C:\Users\me_000\Desktop\f480b6c0.jpeg"when copied directly from the Locals view in Debug mode.
There is another thread citing this issue on SO and the stated solution is to set the FFMPegToolPath property.
fFMpegConverter.FFMpegToolPath = _thumbPathManager.GetFFMPegPath;
I've tried that and various versions of it and I still get the error. I'm using the version of 1.1.2.0 if that helps.
The error pops up no matter what I do with respect to calling FFMpegToolPath, ExtractFFmpeg and what not.
Any help is greatly appreciated.
The problem was very insidious but I figured out what was happening.
I'm using Fody.Costura to merge my DLL resources. This works for all the other DLLS, but the NReco DLLs don't take kindly to being merged. I guess somewhere along the way this is causing file pathing issues since the DLL doesn't exist as a standalone file.
Related
I am quite new to dotnet and Keras.NET, and I was trying to set it up on a goorm.io container. After installing the prerequisites (adding $HOME/.keras/keras.json for Tensorflow backend and pip install numpy), and then adding Keras.NET, I tried to run the XOR sample code, but ran into an error.
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'python37' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libpython37: cannot open shared object file: No such file or directory
at Python.Runtime.Runtime.Py_IsInitialized()
at Python.Runtime.Runtime.Initialize(Boolean initSigs)
at Python.Runtime.PythonEngine.Initialize(IEnumerable1 args, Boolean setSysArgv, Boolean initSigs) at Python.Runtime.PythonEngine.Initialize(Boolean setSysArgv, Boolean initSigs) at Python.Runtime.PythonEngine.Initialize() at Numpy.np.InstallAndImport(Boolean force) at Numpy.np.<>c.<.cctor>b__599_0() at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor) at System.Lazy1.CreateValue()
at System.Lazy1.get_Value() at Numpy.np.get_self() at Numpy.np.get_float32() at Numpy.DtypeExtensions.GetDtype(Object obj) at Numpy.np.array[T](T[,] object, Dtype dtype, Nullable1 copy, String order, Nullable1 subok, Nullable1 ndmin)
at Proj.Program.Main(String[] args) in /workspace/XOR/Proj/Program.cs:line 14
I do not know how to share with the python37 directory. If someone could direct me in the right direction, it would be much appreciated. By the way, I am using Linux if that helps.
Thanks
Running a Console Application as a CGI in IIS on Windows 2012 R2.
On connection to Active Directory (AD), using DirectoryEntry, ref:
lccDEDirectoryEntry = new DirectoryEntry(lccSDomainConnectionString, lccSUserId, lccSUserPassword, lccATAuthTypes);
Then using DirectorySearcher, ref:
lccDSSearcher = new DirectorySearcher(lccDEDirectoryEntry);
Then finding all matching objects, ref:
lccSRCResults = lccDSSearcher.FindAll();
Then finally accessing the search results, ref:
foreach (SearchResult lccSRResultLoop in lccSRCResults)
All works fine, until I try to access the Search Results, it throws an "Illegal Characters In Path".
I can run the same Console Application directly on the server hosting the IIS in a command window and it works fine, including accessing/displaying the SearchResults. Also works fine on Windows 7 workstation/etc.
I hit this same type issue a year ago with a call to HttpUtility, and it ended up being a bug in IIS where it is looking for a configuration setting that is null. Microsoft supplied a fix to use this line:
AppDomain.CurrentDomain.SetData("APP_CONFIG_FILE", Environment.CurrentDirectory + "\" + System.AppDomain.CurrentDomain.FriendlyName + ".config");
Per this blog page:
http://www.dreamincode.net/forums/topic/300197-webrequest-in-a-cgi
And that solved the null configuration setting a year ago, as when you run HttpUtility, IIS looks for an "APP_CONFIG_FILE" setting that is not set when running as a Console Application and isn't used.
Well, my debugging/etc. has shown that the same issue being hit, i.e. a setting is null and so the function "CheckIllegalCharacters" isn't crashing as it can't parse a null value.
Unfortunately, I cannot locate the setting it is looking for. I even enumerated through all AppSetting keys, ref:
https://msdn.microsoft.com/en-us/library/system.appdomain.getdata%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396
And have my code filling each one in with a dummy value, but, no go.
Any clue on how to find the missing setting key name? Or other solution?
Here is the Stack Trace. At the bottom is my function 'lccLDAP', which initiates the rest by calling the SearchResults loop.
STACK TRACE
at System.Security.Permissions.FileIOPermission.CheckIllegalCharacters(String[] str, Boolean onlyCheckExtras)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)
at System.Reflection.RuntimeModule.get_FullyQualifiedName()
at System.Configuration.ClientConfigPaths.SetNamesAndVersion(String applicationFilename, Assembly exeAssembly, Boolean isHttp)
at System.Configuration.ClientConfigPaths..ctor(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigPaths.GetPaths(String exePath, Boolean includeUserConfig)
at System.Configuration.ClientConfigurationHost.RequireCompleteInit(IInternalConfigRecord record)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.DirectoryServices.SearchResultCollection.ResultsEnumerator..ctor(SearchResultCollection results, String parentUserName, String parentPassword, AuthenticationTypes parentAuthenticationType)
at System.DirectoryServices.SearchResultCollection.get_InnerList()
at System.DirectoryServices.SearchResultCollection.get_Item(Int32 index)
at lccCoreFunctionsClass.lccLDAP(lccSettingsClass lccParamSCSettings, Int32 lccLDAPId, Int32 lccIFlag, String lccSParam)
Adding what I finally did. Since my console app runs fine on the IIS server, just not through IIS for Directory.SearchResults, I split the program to run in front-end and back-end modes. The front-end servers IIS web pages, and passes requests to the back-end for LDAP tasks. The back-end then serves responses to the front-end. Good tier-3 security anyway. Just in case others look for a possible solution.
I have a completed game working properly in Android and is published on Play store already. Now I wanted to submit it on iTunes. As soon as I started building the same project for iOS, I got this strange Error -
IOException: Sharing violation on path /Users/abhi/Projects/Unity/XCode Proj/Hammer Inc/Unity-iPhone.xcodeproj/project.pbxproj
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/FileStream.cs:320)
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
(wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
System.IO.File.OpenRead (System.String path) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:363)
System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/StreamReader.cs:167)
System.IO.StreamReader..ctor (System.String path)
(wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string)
System.IO.File.OpenText (System.String path) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:368)
System.IO.File.ReadAllLines (System.String path) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:560)
AdColonyPostProcessBuild.updateXcodeProject (System.String pbxProjectFilePath, System.String thirdPartyFrameworkDirectoryPath, .Framework[] frameworksToAdd) (at Assets/Editor/AdColonyPostProcessBuild.cs:356)
AdColonyPostProcessBuild.OnPostProcessBuild (BuildTarget target, System.String path) (at Assets/Editor/AdColonyPostProcessBuild.cs:340)
UnityEditor.HostView:OnGUI()
I got this error, after I was having some trouble with GPG Plugin and as mentioned here, I deleted the files and folders related to Google Play gaming, since I planned to use Game Center in iOS.
I am currently using Native-X, Adcolony, Revmob in the same project (I know that's too much, but that was due to an experiment on choosing proper network). I am not sure which of the plugin is causing conflicts.
I tried removing the AdColonyPostProcessBuild.cs file, but it gave the following error -
KeyNotFoundException: The given key was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (.TKey
key) (at
/Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/
corlib/System.Collections.Generic/Dictionary.cs:150)
UnityEditor.XCodeEditor.PBXResolver.ResolveName (System.String guid) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:49)
UnityEditor.XCodeEditor.PBXResolver.ResolveName (System.String guid) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:53)
UnityEditor.XCodeEditor.PBXParser.GUIDComment (System.String guid,
System.Text.StringBuilder builder) (at Assets/Editor/iOS/PBX
Editor/PBXParser.cs:218)
UnityEditor.XCodeEditor.PBXParser.SerializeString (System.String
aString, System.Text.StringBuilder builder, Boolean useQuotes, Boolean
readable) (at Assets/Editor/iOS/PBX Editor/PBXParser.cs:546)
UnityEditor.XCodeEditor.PBXParser.SerializeDictionary
(System.Collections.Generic.Dictionary`2 dictionary,
System.Text.StringBuilder builder, Boolean readable, Int32 indent) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:481)
UnityEditor.XCodeEditor.PBXParser.SerializeValue (System.Object value,
System.Text.StringBuilder builder, Boolean readable, Int32 indent) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:439)
UnityEditor.XCodeEditor.PBXParser.SerializeDictionary
(System.Collections.Generic.Dictionary`2 dictionary,
System.Text.StringBuilder builder, Boolean readable, Int32 indent) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:489)
UnityEditor.XCodeEditor.PBXParser.SerializeValue (System.Object value,
System.Text.StringBuilder builder, Boolean readable, Int32 indent) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:439)
UnityEditor.XCodeEditor.PBXParser.Encode
(UnityEditor.XCodeEditor.PBXDictionary pbxData, Boolean readable) (at
Assets/Editor/iOS/PBX Editor/PBXParser.cs:177)
UnityEditor.XCodeEditor.XCProject.CreateNewProject
(UnityEditor.XCodeEditor.PBXDictionary result, System.String path) (at
Assets/Editor/iOS/XCProject.cs:620)
UnityEditor.XCodeEditor.XCProject.Save () (at
Assets/Editor/iOS/XCProject.cs:645) XCodePostProcess.OnPostProcessBuild
(BuildTarget target, System.String path) (at
Assets/Editor/iOS/XCodePostProcess.cs:35) UnityEditor.HostView:OnGUI()
Did anyone faced this issue before and found any solution? I don't want to delete every SDK from the project and start building it again.
I see you have a couple of issues. That sounds like a bummer. But, I would definitely like to help.
What's Happening:
Regarding the first error that you've provided it looks like it's having an issue reading the pbxproj file that Unity creates for the iOS build process.
Typically, when building for iOS, Unity will create a .pbxproj file in conjunction with the rest of the XCode items and then place that in the target build directory you specify. After that it triggers any post process build logic that has been hooked in by the developer.
AdColony's AdColonyPostProcessBuild.cs file is generally intended to be run last out of the post process build logic, because we rely on parsing the .pbxproj file itself, and then adding the information in line by line. The reason we prefer to do this last is because there exist current solutions to this problem that don't necessarily facilitate all the configurations we need, but other developers use it.
The first error looks like it's an access violation issue with the AdColonyPostProcessBuild not being able to access the .pbxproj file, so it can read in all of the lines. Because of this it's throwing an IOException seen here:
IOException: Sharing violation on path /Users/abhi/Projects/Unity/XCode Proj/Hammer Inc/Unity-iPhone.xcodeproj/project.pbxproj
and
System.IO.File.ReadAllLines (System.String path) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:560)
AdColonyPostProcessBuild.updateXcodeProject (System.String pbxProjectFilePath, System.String thirdPartyFrameworkDirectoryPath, .Framework[] frameworksToAdd) (at Assets/Editor/AdColonyPostProcessBuild.cs:356)
This brings me to my next point.
The second error that you've listed is something that arises out of an alternative post process build logic called "XCode Editor For Unity".
You can find it here:
https://github.com/dcariola/XCodeEditor-for-Unity
This solution is a C# implementation of a solution known as mod_pbxproj, and other developers have opted for this solution. However, when using it in conjunction with AdColony it will typically break if the XCode Editor For Unity is performed after the AdColonyPostProcessBuild.cs is run.
This is because some of the information used for the XCode Editor For Unity parsing has been duplicated and is being read in twice, when AdColonyPostProcessBuild.cs is run.
AdColony has configured our post process logic to run last, relying on the ability to parse the information after the XCode Editor For Unity has been run.
The Suggested Solution
The information you've provided has been very helpful, but it's hard to say for certain why these may be arising.
What will facilitate this process is if you could list any other plug-ins you're using that have a post process build applied for iOS builds AND if you can also provide any indications of their priority or order of occurrence on build.
Following that, the line numbers I see in your error output appear a bit inconsistent with the current version of the AdColonyPostProcessBuild.cs file in our current available package.
I would first suggest going to this link, downloading the current package, and re-importing the AdColonyPostProcessBuild.cs
https://github.com/AdColony/AdColony-Unity-SDK
If that doesn't resolve the issue, I would then open up the AdColonyPostProcessBuild.cs file and change its priority to be lower, preferably to be the last post process build item to run. You can do this by changing the number '200' on line 302, to a great number, like '1000'.
If this doesn't resolve your problem I will need to know more about your environment configuration like other plug-ins you are using, and deviations you've made from the default AdColonyPostProcessBuild.cs file.
Regards!
AdColony Support
This problem arose for me because I was using the Facebook SDK with Adcolony's SDK. The Facebook code leaves a streamReader open which produces the error when the Adcolony script is run. Change lines in Assets\Facebook\Editor\iOS\third_party\XCodeEditor-for-Unity\XCProject.cs
from (lines 76-77):
projectFileInfo = new FileInfo(Path.Combine(this.filePath, "project.pbxproj"));
string contents = projectFileInfo.OpenText().ReadToEnd();
to:
projectFileInfo = new FileInfo(Path.Combine(this.filePath, "project.pbxproj"));
StreamReader sr = projectFileInfo.OpenText();
string contents = sr.ReadToEnd();
sr.Close();
(credit to the answer here: "IOException: Sharing violation on path" on building a Unity project on Mac OS X with Facebook Unity SDK 5.1)
I am trying to use an Icon in my WPF application, and some images for other things, but I keep getting errors from the Designer View saying stuff like "path-x is not a valid resource or cannot be found." - where "path-x" is the path of whatever image I am trying to use.
If it were looking in the right place, I bet it'd find it ;)
BUT, then, it decided to not give me that error anymore. So, I went ahead and clicked Run (F5), to see my new Icon in the title bar. Only to be confronted with this beast:
"System.Windows.Markup.XamlParseException
occurred Message='Provide value on
'System.Windows.Baml2006.TypeConverterMarkupExtension'
threw an exception.' Line number '5'
and line position '50'.
Source=PresentationFramework
LineNumber=5 LinePosition=50
StackTrace:
at System.Windows.Markup.XamlReader.RewrapException(Exception
e, IXamlLineInfo lineInfo, Uri
baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader
xamlReader, IXamlObjectWriterFactory
writerFactory, Boolean
skipJournaledProperties, Object
rootObject, XamlObjectWriterSettings
settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader
xamlReader, Boolean
skipJournaledProperties, Object
rootObject, XamlAccessLevel
accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream
stream, ParserContext parserContext,
Object parent, Boolean closeStream)
at System.Windows.Application.LoadComponent(Object
component, Uri resourceLocator)
at One_Stop_Management.MainWindow.InitializeComponent()
in c:\Users\Jason\Documents\Visual
Studio 2010\Projects\One Stop
Management\One Stop
Management\MainWindow.xaml:line 1
at One_Stop_Management.MainWindow..ctor()
in C:\Users\Jason\Documents\Visual
Studio 2010\Projects\One Stop
Management\One Stop
Management\MainWindow.xaml.cs:line 25
InnerException: System.IO.IOException
Message=Cannot locate resource 'images/favicon.ico'.
Source=PresentationFramework
StackTrace:
at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode
mode, FileAccess access)
at System.IO.Packaging.PackagePart.GetStream(FileMode
mode, FileAccess access)
at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
at System.IO.Packaging.PackWebResponse.GetResponseStream()
at System.IO.Packaging.PackWebResponse.get_ContentType()
at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri
uri, Stream stream, BitmapCacheOption
cacheOption, Guid& clsId, Boolean&
isOriginalWritable, Stream& uriStream,
UnmanagedMemoryStream&
unmanagedMemoryStream, SafeFileHandle&
safeFilehandle)
at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri
baseUri, Uri uri, Stream stream,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption,
RequestCachePolicy uriCachePolicy,
Boolean insertInDecoderCache)
at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri
baseUri, Uri uri, Stream stream,
BitmapCreateOptions createOptions,
BitmapCacheOption cacheOption,
RequestCachePolicy uriCachePolicy)
at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext
context, CultureInfo culture, Object
value)
at System.Windows.Baml2006.TypeConverterMarkupExtension.ProvideValue(IServiceProvider
serviceProvider)
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension
me, IServiceProvider serviceProvider)
InnerException: "
Why is this thing giving me attitude? I'm just trying to insert an image...
Updates
Here is the XAML that was produced for the icon when I tried to add the Icon using the Properties Pane:
<Fluent:RibbonWindow x:Class="One_Stop_Management.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Fluent="clr-namespace:Fluent;assembly=Fluent"
Title="One Stop Management" Height="727" Width="1208" Icon="Resources\favicon.ico">
Latest Update
I can't even add an icon using the properties pane, below is the error it gives me.
Make sure the target is a resource. Then do something like this:
Icon="/MobilWPF;component/Resources/Images/MobileIcon.ico"
where MobilWPF is your namespace, or maybe you're project name? I forget my project name and my namespace are the same.
I've discovered that VS2008 sometimes causes problems like this when you add new resources and then rebuild the project. I've found if you clean the build and then rebuild from scratch the problem disappears. Looks like a VS2008 bug to me.
I fixed this same issue by setting these properties for the image:
Build Action = Content
Copy to Output Directory = Copy always
The exception, if you read through it, says the same thing:
InnerException: System.IO.IOException Message=Cannot locate resource 'images/favicon.ico'.
This is probably because the Images/favicon.ico icon image is not setup correctly. Make sure that it's Build Action is set to "Resource", and that it's in the project under the "Images" folder.
The answer seems to depend on where/how you store the icon. I was trying to do something similar to #iterationx's answer but it didn't work for me, and this is what I finished up with. I'm using VS 2010.
I added the icon as a resource via the project's properties page, under Resources, Add Resource (dropdown), Add existing file. Then I just used the file name in the Icon property:
Icon="my_icon.ico"
I recall a similar situation where my application was crashing, and I eventually tracked it down to an .ico error.
If you're using icons and Windows XP, XP does not support the 256x256 icons. You may need to open the icon in an editor, such as IcoFx, and delete the 256x256 icon.
Setting BuildAction to Resource in resource Properties solved this problem.
Greets
I'm sorry I can't be more helpful. On reading your question at first I thought it'd be just a type mismatch, like where you were specifying a string when it was meant to be an image. The issue seems to be one that has multiple possible resolutions. Instead of listing them all I'll just link you to the Microsoft Connect page that has them on it.
I had this same problem and found that if your project has a space in the name, it won't read the image files correctly. Hope that helps.
use Icon=".\Images\test.ico" this got me working
The "ResolveManifestFiles" task failed unexpectedly.
System.ArgumentException: Illegal characters in path.
at System.Security.Permissions.FileIOPermission.HasIllegalCharacters(String[] str)
at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)
at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
at System.IO.Path.GetFullPath(String path)
at Microsoft.Build.Tasks.Deployment.ManifestUtilities.Util.RemoveDuplicateItems(ITaskItem[] items)
at Microsoft.Build.Tasks.ResolveManifestFiles.set_NativeAssemblies(ITaskItem[] value)
The "NativeAssemblies=#(NativeReferenceFile);#(_DeploymentNativePrerequisite)" parameter for the "ResolveManifestFiles" task is invalid.
The "ResolveManifestFiles" task could not be initialized with its input parameters.
I was getting the same build errors until I allowed VFP to automatically register my COM Library after it was built. After I did that I had to remove my reference to the .dll from my project and re-add it and after that my project built and ran just file.
If your having this problem you may want to look to make sure that you don't have a reference to a native library that isn't registered. To register such a .dll manually use the Regsvr32 utility.