.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simple build problem for autocad 2014

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
JONTHEPOPE
896 Views, 5 Replies

Simple build problem for autocad 2014

Do I have to change the version to 3.5?

If I do that will it get ride of my error message?

 

1>------ Build started: Project: lab 2014, Configuration: Release Any CPU ------

1>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1635,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "accoremgd", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

 

1>  lab 2014 -> C:\test\lab 2014\lab 2014\bin\Release\lab 2014.dll

========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

5 REPLIES 5
Message 2 of 6
JONTHEPOPE
in reply to: JONTHEPOPE

I also keep getting a error that says

 

 

A project with an Output Type of Class Libary cannot be started

directly.

 

In order to debug this project, add an executable project to this solution

which references the libary project. Set the executable project as the

startup project.

 

It would be nice if any one could tell me what is going wrong and how I could fix it.

Message 3 of 6
Keith.Brown
in reply to: JONTHEPOPE

You get that error because you are compiling for Any CPU when your processer is either a x86 or a AMD64.  It cannot be both.  You are probably safe to keep it at ANY CPU as long as you are not accessing any architecture specific DLL's.  If you want to keep it at ANY CPU then you can supress the warning by adding the following lines to your .csproj or .vbproj files.

 

<PropertyGroup>
  <ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
    None
  </ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>

 

HTHs

Message 4 of 6
JONTHEPOPE
in reply to: JONTHEPOPE

attempted code below

 

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;

[assembly: CommandClass(typeof(lab_2014.Class1))]

namespace lab_2014
{
    public class Class1
    {
        [CommandMethod("FeetToInches")]
        public void Main()
        {
            Console.Write(FeetToInches(30));
            Console.Write(FeetToInches(100));
        }

        static int FeetToInches (int feet)
        {
            int inches = feet * 12;
            return inches;
        }
    }
}

 

Message 5 of 6
JONTHEPOPE
in reply to: JONTHEPOPE

Thanks, that's the most progress I've made in weeksSmiley Embarassed

Message 6 of 6
Keith.Brown
in reply to: JONTHEPOPE


@JONTHEPOPE wrote:

I also keep getting a error that says

 

 

A project with an Output Type of Class Libary cannot be started

directly.

 

In order to debug this project, add an executable project to this solution

which references the libary project. Set the executable project as the

startup project.

 

It would be nice if any one could tell me what is going wrong and how I could fix it.


Since you are creating a DLL file and not an executable you need to let Visual Studio know what executable should be ran with your DLL file.  You can do this in the project properties by choosing AutoCAD as your external program.

 

Debug.png

 

 

 

I believe if you have an express version then you will not be able to set it using this method but will instead have to manuall set the executable in your project user file.   You can read about it here.

 

 

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