.NET

Reply
Distinguished Contributor
HJohn1
Posts: 170
Registered: ‎09-26-2008
Message 1 of 4 (874 Views)
Accepted Solution

Visual Studio 2010 Project Save As

874 Views, 3 Replies
01-28-2014 07:54 AM

I would like to know what will be the best way to save a visual studio project as, give the assembly a different name and change the framework version from 3.5 to 4.0.  Since VS does not have a save as command, I think I can start a brand new project with the required name and framework version and then import (add existing item) from the old project, classes, forms and modules.  I don't know if this is the best way to go about it or even if this is right way.  Can someone please give me some help and tell me if this is the way to go.

 

I ran into a problem which I posted about a few days ago, I was getting a "Source not available" message.  I think that it was caused by mixing 32bit and 64bit part of projects. I almost could not recover the project I was working on, so I don't want to lose it again.  I have a working project for AutoCAD 2012 that I need to modify to work on AutoCAD 2014.

The simple way that I do would be:

 

1. Copy the entire project folder with the project file to a new folder, which is named as the new project name of your choice. Of course at this point, the project still has its old name;

2. Open the project in VS, right-click the project name in Solution Explorer to rename the project, so the project name will be the same as the folder name, as common convention.

3. Open the project properties page and change the targeting .NET framework, references...

 

These steps seems a easier than starting a new project, importing all the code files, setting references...

 

As for your previous "Source not available" post, I think because you did not describe your situation in detail (such as the version of AutoCAD and/or VS, the code...), people hesitate to jump in to reply. Very often, when people see a question is asked with little detail information to help understand the question, they are likely pass it and leave it unanswered.

 

In AutoCAD .NET programming, the "Source not available" issue in VS debugging is typically related to AutoCAD's FIBERWORLD (when it value is 1), which is an topic that has been beaten to death, but alway resurfaced back now and then. If your debugging is started from a UI component (Windows Form), such a dialog box or PaletteSet, if the FIBERWORLD is 1, you get that issue. You need to set FIBERWORLD to 0 with command NEXTFIBERWORLD, and restart AutoCAD. To avoid the trouble of setting FIBERWORLD = 0 (and making ribbon/menu useless), it is better to separate Acad operation code with the UI code, which is a "best-practice" approach anyway.

 

*Expert Elite*
norman.yuan
Posts: 998
Registered: ‎04-27-2009
Message 2 of 4 (858 Views)

Re: Visual Studio 2010 Project Save As

01-28-2014 09:02 AM in reply to: HJohn1

The simple way that I do would be:

 

1. Copy the entire project folder with the project file to a new folder, which is named as the new project name of your choice. Of course at this point, the project still has its old name;

2. Open the project in VS, right-click the project name in Solution Explorer to rename the project, so the project name will be the same as the folder name, as common convention.

3. Open the project properties page and change the targeting .NET framework, references...

 

These steps seems a easier than starting a new project, importing all the code files, setting references...

 

As for your previous "Source not available" post, I think because you did not describe your situation in detail (such as the version of AutoCAD and/or VS, the code...), people hesitate to jump in to reply. Very often, when people see a question is asked with little detail information to help understand the question, they are likely pass it and leave it unanswered.

 

In AutoCAD .NET programming, the "Source not available" issue in VS debugging is typically related to AutoCAD's FIBERWORLD (when it value is 1), which is an topic that has been beaten to death, but alway resurfaced back now and then. If your debugging is started from a UI component (Windows Form), such a dialog box or PaletteSet, if the FIBERWORLD is 1, you get that issue. You need to set FIBERWORLD to 0 with command NEXTFIBERWORLD, and restart AutoCAD. To avoid the trouble of setting FIBERWORLD = 0 (and making ribbon/menu useless), it is better to separate Acad operation code with the UI code, which is a "best-practice" approach anyway.

 

Active Contributor
CADbloke
Posts: 38
Registered: ‎08-12-2008
Message 3 of 4 (843 Views)

Re: Visual Studio 2010 Project Save As

01-28-2014 12:17 PM in reply to: HJohn1

You don't need to, and really should not create a duplicate project - this will only bring you grief as you now need to maintain both. No no no no nooooooo.

 

Have you considered adding a build configuration for a 2014 version? See http://msdn.microsoft.com/en-us/library/kwybya3w.aspx

If you want to really break things tweak the build, see http://www.theswamp.org/index.php?topic=41868.msg497509#msg497509 and then read that whole thread. Make a copy of your solution and experiment with it ... while you learn Git (see below)

 

You will also need a couple of code tweaks for API changes over the years, see http://www.theswamp.org/index.php?topic=41047 if you've used anything like Pinvoke. I'm sure there are answers on this forum too, I just happen to remember these ones. 

 

"I almost could not recover the project I was working on, so I don't want to lose it again"

 

Use source control! Please. It's like the immunisation argument - just do it and it will save your life, often without you even noticing. You can break anything you like in your code and bring it back in a few clicks. See http://www.theswamp.org/index.php?topic=32381.msg486114#msg486114 Trust me - you will wonder how you ever managed to live without it and you will be a braver and better developer for it. Git and KilnHg.com are my current recommendation for private projects (I usually use Hg but it's a Coke / Pepsi thing).

Distinguished Contributor
HJohn1
Posts: 170
Registered: ‎09-26-2008
Message 4 of 4 (794 Views)

Re: Visual Studio 2010 Project Save As

01-30-2014 11:43 AM in reply to: CADbloke

Thank you both for your help, really appreciated.  CADbloke I never used source control but I will definitely look into it.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.