Problems with Parallel build using MSBuild - multithreading

We've tried to run next command:
MSBuild.exe ..\src\YaccConstructor.WithoutTests.sln /t:Build /m:8 /v:q /p:Optimize="True" /p:DebugSymbols="True" /p:Configuration="Release" /logger:Fake.MsBuildLogger+TeamCityLogger,"C:\Users\User\Documents\Project\recursive-ascent\tools\Build.Tools\Fake\FakeLib.dll" /logger:Fake.MsBuildLogger+ErrorLogger,"C:\Users\User\Documents\Project\recursive-ascent\tools\Build.Tools\Fake\FakeLib.dll"
After that we've got the next exception:
MSBUILD : error MSB4166: Child node "6" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.
In the MSBuild_*.failure.txt is the next information:
System.Runtime.Serialization.SerializationException: Type 'Microsoft.Build.BackEnd.TaskHost' in Assembly 'Microsoft.Build, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.
at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at Microsoft.Build.BackEnd.NodePacketTranslator.NodePacketWriteTranslator.TranslateDotNet[T](T& value)
at Microsoft.Build.Shared.LogMessagePacketBase.WriteToStream(INodePacketTranslator translator)
at Microsoft.Build.Shared.LogMessagePacketBase.Translate(INodePacketTranslator translator)
at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.PacketPumpProc()
We've see all of the follow information:
Compiler Issue in Windows 7: A generic error occurred in GDI+
error MSB4166: Child node exited prematurely. Shutting down
MSBUILD fails with "The process cannot access the file xxxxx because it is being used by another process." when maxcpucount is greater than 1
And nothing helped.
Anyone knows how to solve this problem?

Try explicitly calling the build with MsBuild 4.0 to rule out version 12.0
Try ruling out the custom loggers by omitting the /logger switches.
Try ruling out parallel builds by commenting out the /M switch.
Try piping the diagnostic output to a separate file and see if you can get more fidelity on the error.
%windir%\Microsoft.NET\Framework\v4.0.30319 ..\src\YaccConstructor.WithoutTests.sln /t:Build /m /v:q /p:Optimize="True";DebugSymbols="True";Configuration="Release" /fl1 /flp1:Verbosity=diag;logfile=msbuild_diag.log

Related

Xamarin release build fails after adding nlog support for Azure Blob Storage

After adding NLog to our Xamarin forms app with support for the Azure Blob Storage, the Android Release builds fail with the following:
Error Mono.Linker.MarkException: Error processing method: 'System.Void Microsoft.Azure.Services.AppAuthentication.AdalAuthenticationContext/<AcquireTokenAsync>d__3::MoveNext()' in assembly: 'Microsoft.Azure.Services.AppAuthentication.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Threading.Tasks.Task`1<Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationResult> Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContextIntegratedAuthExtensions::AcquireTokenAsync(Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext,System.String,System.String,Microsoft.IdentityModel.Clients.ActiveDirectory.UserCredential)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.RunTask()
at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/builder/azdo/_work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 iliidit.Android
I've traced it down to the package NLog.Extensions.AzureBlobStorage and see that this package has Microsoft.Azure.Services.AppAuthentication as a dependency (which is in the error message!).
I've found: https://stackoverflow.com/a/69050534/11269239 which is sort of similar, but a different binary. Have tried to setup the linker file, but can't seem to work it out...
Reading this: https://learn.microsoft.com/en-us/xamarin/cross-platform/deploy-test/linker
I have tried many combinations, but think this the most precise.
<linker>
<assembly fullname="Microsoft.IdentityModel.Clients.ActiveDirectory">
<type fullname="AuthenticationContextIntegratedAuthExtensions">
<method name="AcquireTokenAsync" />
</type>
</assembly>
</linker>
And set the Build Action to LinkDescription.
I've also tried wildcards.... not sure what I'm doing wrong :(
New updated NLog.Extensions.AzureBlobStorage ver 4.0 has now been released, that switches from legacy AzureServiceTokenProvider to the new Azure.Identity:
https://www.nuget.org/packages/NLog.Extensions.AzureBlobStorage
Hope it will resolve the build issues on the Android-platform

All unit tests Inconclusive when run in VS 2019

I'm using Unit Test Explorer and Unit Test Sessions to run my tests and suddenly get the below error.
When running in Test -> Test explorer, the tests do not run at all and I see no errors.
In both cases there is nothing in Output window. I've reinstalled R#, cleared VS cache (in %USERPROFILE%\AppData\Local\Microsoft), restarted windows, restarted VS.
2019.10.25 14:54:08.058 ERROR Remote: An exception occurred while invoking executor 'executor://mstestadapter/v2': Method not found: 'Void Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.set_CancellationTokenSource(System.Threading.CancellationTokenSource)'.
--- EXCEPTION #1/1 [LoggerException]
Message = “Remote: An exception occurred while invoking executor 'executor://mstestadapter/v2': Method not found: 'Void Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.set_CancellationTokenSource(System.Threading.CancellationTokenSource)'.”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.ReSharper.UnitTesting.MSTest.Provider.New.TestHost.TestHostMsTestRunner.TestExecutionEventHandler.HandleLogMessage(TestMessageLevel level, String message)
at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleRequestSender.SendMessageAndListenAndReportTestResults(String messageType, Object payload, ITestRunEventsHandler eventHandler, ITestHostLauncher customHostLauncher)
(...)
I've updated the NuGet packages MSTest.TestAdapter and MSTest.TestFramework to the newest version (v2.0.0) in the whole solution and the problem was solved.

FileNotFoundException for Microsoft.VisualStudio.QualityTools.UTFResources when deploying to Azure Websites

I'm using Azure Websites git deploy (via Kudu), and everything has been going great, until today. When I do a new git push, and it tries to deploy, I get this error message while my tests are running:
Error: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UTFResources, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
I haven't added or removed any libraries or other references from my solution between the last successful push and when I started getting this errors. Googling doesn't turn up anything. That file is in my local GAC, but I can't find it referenced directly anywhere in my solution.
Redeploying an old version of my solution - a version that deployed correctly earlier in the day - fails with the same error message.
If I didn't know better, I'd think that MS changed something on their end and broke kudu.
Any thoughts about troubleshooting this, shy of opening a ticket with Azure?
EDIT - More Details:
It's failing while running the unit tests. Here's the relevant portion of my deploy.cmd:
:: 1. Build to the temporary path
IF /I "%IN_PLACE_DEPLOYMENT%" NEQ "1" (
%MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\Payboard.Web\Payboard.Web.csproj" /nologo /verbosity:m /t:Build /t:pipelinePreDeployCopyAllFilesToOneFolder /p:_PackageTempDir="%DEPLOYMENT_TEMP%";AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
) ELSE (
%MSBUILD_PATH% "%DEPLOYMENT_SOURCE%\Payboard.Web\Payboard.Web.csproj" /nologo /verbosity:m /t:Build /p:AutoParameterizationWebConfigConnectionStrings=false;Configuration=Release /p:SolutionDir="%DEPLOYMENT_SOURCE%\.\\" %SCM_BUILD_ARGS%
)
IF !ERRORLEVEL! NEQ 0 (
echo Build failed with ErrorLevel !0!
goto error
)
:: 2. Building test projects
rem echo Building test projects
"%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\PayboardWeb.sln" /p:Configuration=NoDatabase;VisualStudioVersion=12.0 /verbosity:m /p:Platform="Any CPU"
IF !ERRORLEVEL! NEQ 0 (
echo Build failed with ErrorLevel !0!
goto error
)
:: 3. Running tests
echo Running tests
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Common.Tests\bin\NoDatabase\Payboard.Common.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Model.Tests\bin\NoDatabase\Payboard.Model.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Services.Tests\bin\NoDatabase\Payboard.Services.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Integrations.Tests\bin\NoDatabase\Payboard.Integrations.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error
vstest.console.exe "%DEPLOYMENT_SOURCE%\Payboard.Web.Tests\bin\NoDatabase\Payboard.Web.Tests.dll"
IF !ERRORLEVEL! NEQ 0 goto error
It's failing during the first call to vstest.console.exe, after successfully running a whole bunch of the unit tests, but before finishing. Here's an example of the log file:
Passed ConditionalFormatting_ShouldHandleSimpleConditions
Passed ConditionalFormatting_ShouldHandleComplexNumericConditions
Passed ConditionalFormatting_ShouldHandleNullStrings
Passed ConditionalFormatting_ShouldHandleNullObjects
Error: Exception thrown executing tests in D:\home\site\repository\Payboard.Common.Tests\bin\NoDatabase\Payboard.Common.Tests.dll
Passed ShallowClone_ShouldCopyIntegers
Passed ShallowClone_ShouldCopyNullableIntegers
Error: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.UTFResources, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Passed ShallowClone_ShouldCopyStrings
File name: 'Microsoft.VisualStudio.QualityTools.UTFResources, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Passed ShallowClone_ShouldNotCopyReferences
Passed ShallowClone_ShouldReturnNullIfSourceIsNull
Server stack trace:
Passed ShallowCopyTo_ShouldCopyIntegers
at Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionAttribute..ctor(Type exceptionType, String noExceptionMessage)
Passed ShallowCopyTo_ShouldCopyNullableIntegers
at Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionAttribute..ctor(Type exceptionType)
Passed ShallowCopyTo_ShouldCopyStrings
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
Passed ShallowCopyTo_ShouldNotCopyReferences
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
Passed ShallowCopyTo_ShouldNotCopyExceptions
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
Passed ShallowCopyTo_ShouldNotCopyExceptionExpressions
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeMethodInfo method, RuntimeType caType, Boolean inherit)
Passed GetFriendlyTypeName_ShouldHandleSimpleTypes
at System.Reflection.RuntimeMethodInfo.GetCustomAttributes(Boolean inherit)
Passed GetFriendlyTypeName_ShouldHandleComplexTypes
at NUnit.Core.Reflect.GetAttributes(ICustomAttributeProvider member, Boolean inherit)
Passed GetFriendlyTypeName_ShouldHandleReallyComplexTypes
at NUnit.Core.Reflect.HasAttribute(ICustomAttributeProvider member, String attrName, Boolean inherit)
Passed MultiDateTimeConverter_ShouldSupportMultipleFormats
at NUnit.Core.Reflect.HasMethodWithAttribute(Type fixtureType, String attributeName, Boolean inherit)
Passed OrIfGreater_ShouldSelectGreaterValue
at NUnit.Core.Builders.NUnitTestFixtureBuilder.CanBuildFrom(Type type)
Passed OrIfGreater_ShouldSelectRealValue
at NUnit.Core.Extensibility.SuiteBuilderCollection.CanBuildFrom(Type type)
Passed OrIfLesser_ShouldSelectGreaterValue
at NUnit.Core.TestFixtureBuilder.CanBuildFrom(Type type)
Passed OrIfLesser_ShouldSelectRealValue
at NUnit.Core.Builders.TestAssemblyBuilder.GetFixtures(Assembly assembly, String ns)
Passed GetKey_ShouldSupportStrings
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
Passed GetKey_ShouldSupportInts
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
Passed GetKey_ShouldSupportDates
at NUnit.Core.TestSuiteBuilder.BuildSingleAssembly(TestPackage package)
Passed ForEachParallel_ShouldExecuteAllActions
at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
Passed ForEachParallel_ShouldExecuteWithMaxParallelization
at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
Passed SelectParallel_ShouldSelectAllData
at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
Passed SelectParallel_ShouldSelectWithMaxParallelization
at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
Passed SortOfMatches_ShouldMatchSameUrls
at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
Passed SortOfMatches_ShouldIgnoreQueryStrings
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
Passed SortOfMatches_ShouldIgnoreShortPrefixes
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Passed SortOfMatches_ShouldNotMatchOnPathMismatch
Passed SortOfMatches_ShouldNotMatchOnHostMismatch
Exception rethrown at [0]:
Passed MainDomain_ShouldRemoveWww
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
Passed MainDomain_ShouldRemoveApp
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
Passed MainDomain_ShouldNotRemoveExample
at NUnit.Core.TestRunner.Load(TestPackage package)
Passed MainDomain_ShouldNotRemoveMainDomain
at NUnit.Util.TestDomain.Load(TestPackage package)
Passed MainDomain_ShouldHandleCountryDomains
at NUnit.VisualStudio.TestAdapter.NUnitTestExecutor.RunAssembly(String assemblyName, ITestExecutionRecorder testLog, TestFilter filter, IRunContext runContext)
Total tests: 117. Passed: 116. Failed: 0. Skipped: 1.
Test execution time: 7.5134 Seconds
An error has occurred during web site deployment.
Test Run Failed.
I should note that if I comment out the calls to the unit tests, I can get it to deploy. So I suppose the question is basically - what can I do to get my unit tests running again? Is it possible that the recent update to the Azure websites - the one that supported, among other things, TypeScript 1.1 - could have possibly removed Microsoft.VisualStudio.QualityTools.UTFResources.dll from the GAC? Or something along those lines?
Have a look here:
https://developercommunity.visualstudio.com/content/problem/35104/systemiofilenotfoundexception-utfresourcesdll.html
The suggestion was to de-reference Microsoft.VisualStudio.QualityTools.UnitTestFramework and add NuGet packages MSTest.TestFramework and MSTest.TestAdapter
On my VSTS build definition, I also had to change the checkout process to clean the All Build Directories
This solved the FileNotFound exception I was getting for the same DLL.
As discussed in the comments, this does appear to be a recent regression. I have opened https://github.com/projectkudu/kudu/issues/1370 to track it and discussed further.
I just lower down the version from 10.1.0.0 to 10.0.0.0. and it worked!!!

Failing to load ServiceBus Assembly when debugging

I am implementing azure service bus functionality into a clients asp.net webforms solution.
a worker role polls the bus periodically for new messages, and a web role is defined for the existing webforms app, which is responsible for adding putting messages on the bus queue.
Whenever i try to run the app locally i get an error due to the Microsoft.ServiceBus assembly being a mismatch from the expected...
System.IO.FileLoadException was unhandled
HResult=-2146234304
Message=Could not load file or assembly 'Microsoft.ServiceBus, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Source=Azure.EnquiryWorker
FileName=Microsoft.ServiceBus, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
FusionLog==== Pre-bind state information ===
LOG: User = *Omitted*
LOG: DisplayName = Microsoft.ServiceBus, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Users/*path omitted*/*project name omitted*/csx/Debug/roles/Azure.EnquiryWorker/approot
LOG: Initial PrivatePath = C:\Users\*path omitted*/*project name omitted*\csx\Debug\roles\Azure.EnquiryWorker\approot
Calling assembly : Azure.EnquiryWorker, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\*path omitted*/*project name omitted*\csx\Debug\roles\Azure.EnquiryWorker\approot\Azure.EnquiryWorker.dll.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.ServiceBus, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/*path omitted*/*project name omitted*/csx/Debug/roles/Azure.EnquiryWorker/approot/Microsoft.ServiceBus.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
StackTrace:
at Azure.EnquiryWorker.WorkerRole.OnStart()
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRoleInternal(RoleType roleTypeEnum)
at Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.InitializeRole(RoleType roleType)
at Microsoft.WindowsAzure.ServiceRuntime.Implementation.Loader.RoleRuntimeBridge.<InitializeRole>b__0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
The webforms app has the serviceBus dll in the bin folder (which is added as an indirect reference, as the service bus code resides in a library project).
The GAC contains no servicebus assemblies, my projects are all referencing v2 of the servicebus dll, and are set to CopyLocal.
This problem conveniently went away when i updated the Azure ServiceBus Nuget package to version 2.1.
To help debug this can you confirm on your local machine if you have Microsoft.ServiceBus.dll in the GAC? Also check if that version is different from what you have referenced in the project.
It seems like your project does not have the DLL, or a correct version of it. Build the applicaiton and look in the /bin folder. If you find the DLL (Microsoft.ServiceBus.dll), check the version and make sure it matches (Version=2.0.0.0). If you can't find it, it might be in your Global Assembly Cache.
If this doesn't help you, try:
1. Set copylocal = true in your reference properties so that the DLL is copied into your output directory.
2. Use nuget package manager to link to the Microsoft.Servicebus dll. It usually solves a lot of similar problems.

Can't run my program on XP, because it says that can't load a dll(written by me), but on Windows 7 it runs

I've already seen some posts about my problem, but no solution...
My application needs to load a dll written by me, when I try to run it on Windows 7 it goes, but on XP it crashes.
So I tried to install VS2010 on XP and compiling there, it compiles correctly, but when i debug it throws System.IO.FileNotFoundException, because it "can't" load my dll (Could not load file or assembly 'Graphic.dll'), so it seems that can't find my dll, how can it be possible?
p.s: dll (managed class library) and exe are written in c++ and use .net framework 4
Fusion log 1: Assembly Binder Log Entry(09/04/2012 # 11.52.42)
The operation was successful. Bind result: hr = 0x0. The operation
completed successfully.
Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under
executable C:\Documents and Settings\Administrator\My
Documents\Visual Studio 2010\Projects\MyProgram\Debug\MyProgram.exe A
detailed error log follows.
LOG: EXE explicit bind. File path:C:\Documents and
Settings\Administrator\My Documents\Visual Studio
2010\Projects\MyProgram\Debug\MyProgram.exe.
Fusion log 2:
Assembly Binder Log Entry (09/04/2012 # 11.52.42) The operation was
successful. Bind result: hr = 0x0. The operation completed
successfully.
Assembly manager loaded from:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under
executable C:\Documents and Settings\Administrator\My
Documents\Visual Studio 2010\Projects\MyProgram\Debug\MyProgram.exe A
detailed error log follows.
Pre-bind state information LOG: User = CASH-F32CDFF50A\Administrator
LOG: DisplayName = System.Windows.Forms, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 (Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/Administrator/My
Documents/Visual Studio 2010/Projects/MyProgram/Debug/ LOG: Initial
PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL
LOG: AppName = MyProgram.exe Calling assembly : MyProgram,
Version=1.0.4482.18830, Culture=neutral, PublicKeyToken=null.
LOG: This bind starts in default load context. LOG: No application
configuration file found. LOG: Using host configuration file: LOG:
Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: System.Windows.Forms, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 LOG: Reusing an
assembly instance that was previously loaded
(C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll).

Resources