Please don't tell me you can't run/use Visual Studio 2010 stuff inside AutoCAD 2011?.......
I have done a couple of small AutoCAD 2011 (AcadMap, actually) projects with VS2010, trageting .NET4.0. No issue so far.
Of course I had to add this into acad.exe.config:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
...
</configuration>
My acad.exe.config.....contains what you state below.
However, I tried running a sample .DLL (sample taken from AutoCAD (2010) .Net Developers Guide), and I get the following errors:
Command: netload
Cannot load assembly. Error details: System.BadImageFormatException: Could not
load file or assembly 'file:///D:\My Documents\Visual Studio
2010\Projects\MyFirstProject\MyFirstProject\obj\Debug\MyFirstProject.dll' or
one of its dependencies. This assembly is built by a runtime newer than the
currently loaded runtime and cannot be loaded.
File name: 'file:///D:\My Documents\Visual Studio
2010\Projects\MyFirstProject\MyFirstProject\obj\Debug\MyFirstProject.dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm,
Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
at loadmgd()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure
logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
Any ideas?
attached is my acad.exe.config file (renamed so I could attach)
1. Do you use Acad2011?
2. In your attached acad.exe.config, you have <!--....--> that comments out the needed setting. Are you sure you do not have <!-- ... --> in your real acad.exe.config?
Thx....that fixed the problem (I had the required line commented out...jeeez!)
HI I have the same problem which is stated earlier. When I try to to load the .dll show following error:
Command: netload
Cannot load assembly. Error details: System.BadImageFormatException: Could not
load file or assembly 'file://\\home003.vih.infineon.com\alamzaki\My
Documents\Visual Studio
2010\Projects\MyFirstProject\MyFirstProject\bin\Debug\MyFirstProject.dll' or
one of its dependencies. This assembly is built by a runtime newer than the
currently loaded runtime and cannot be loaded.
File name: 'file://\\home003.vih.infineon.com\alamzaki\My Documents\Visual
Studio 2010\Projects\MyFirstProject\MyFirstProject\bin\Debug\MyFirstProject.dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm,
Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
at loadmgd()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure
logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].
MY acad.exe.config file is:
<configuration>
<configSections>
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/></configSections><!--
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
-->
<!--All assemblies in AutoCAD are fully trusted so there's no point generating publisher evidence-->
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
<appSettings>
<add key="WebServiceTimeout" value="1000000"/></appSettings><microsoft.web.services3>
<messaging>
<maxMessageLength value="51200"/><mtom clientMode="On"/></messaging><security>
<timeToleranceInSeconds value="86400"/></security></microsoft.web.services3><loggingConfiguration name="Logging Application Block" tracingEnabled="true" defaultCategory="" logWarningsWhenNoCategoriesMatch="false"><listeners>
<add fileName="rolling.log" rollSizeKB="0" timeStampPattern="yyyy-MM-dd" rollFileExistsBehavior="Increment" rollInterval="Day" formatter="Text Formatter" header="" footer="----------------------------------------" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" traceOutputOptions="LogicalOperationStack" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Rolling Flat File Trace Listener"/></listeners><formatters>
<add template="{timestamp} ({win32ThreadId}) {message}
Category: {category}{dictionary(
{key}: {value})}" type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.9.9.2, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" name="Text Formatter"/></formatters><categorySources>
<add switchValue="All" name="Information"><listeners>
<add name="Rolling Flat File Trace Listener"/></listeners></add><add switchValue="All" name="Error"><listeners>
<add name="Rolling Flat File Trace Listener"/></listeners></add><add switchValue="off" name="Trace"><listeners>
<add name="Rolling Flat File Trace Listener"/></listeners></add></categorySources><specialSources>
<allEvents name="All Events" switchValue="All"/><notProcessed name="Unprocessed Category" switchValue="All"/><errors name="Logging Errors & Warnings" switchValue="All"/></specialSources></loggingConfiguration></configuration>
I can not recity the problem. I am using VB2010 (Premium), AutoCAD2011. Windows 7 32 bit machine. Can you help me to solve this problem?
Thanks in advance.
Zakir
Hello Zakir,
In what you have posted, I see those <!-- and -->
You too seem to have the lines that specify the supportedRuntime in acad.exe.config commented.
Can you try removing those comment markers ?
Hope this helps.