.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 9
jerry.bryant
1128 Views, 8 Replies

VS 2010

Please don't tell me you can't run/use Visual Studio 2010 stuff inside AutoCAD 2011?.......

Jerry Bryant
"Swing hard and hope you hit it!"
8 REPLIES 8
Message 2 of 9
norman.yuan
in reply to: jerry.bryant

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>

Message 3 of 9
Jeffrey_H
in reply to: jerry.bryant

You can't run Visual Studio 2010 stuff inside AutoCAD 2011, but you can use Visual Studio 2010 to develop apps for 2011, 2010,  2009,  and how ever far it goes back.

You can also find your answers @ TheSwamp
Message 4 of 9
Jeffrey_H
in reply to: Jeffrey_H

Really no issues with 4.0 you must not be using any new features in 4.0 that directly interact with AutoCAD. Then I would play it safe with 3.5

You can also find your answers @ TheSwamp
Message 5 of 9
jerry.bryant
in reply to: norman.yuan

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)

 

Jerry Bryant
"Swing hard and hope you hit it!"
Message 6 of 9
norman.yuan
in reply to: jerry.bryant

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?

 

Message 7 of 9
jerry.bryant
in reply to: norman.yuan

Thx....that fixed the problem (I had the required line commented out...jeeez!)

Jerry Bryant
"Swing hard and hope you hit it!"
Message 8 of 9
mzakiralam
in reply to: jerry.bryant

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 &amp; 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

Message 9 of 9
Balaji_Ram
in reply to: mzakiralam

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.



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost