Getting an error message when creating a new project from my template - visual-studio-2012

I created a project template from an existing project, in this case it is just a resource DLL.
I replaced some of the data in the projects with the $projectname$ tags so that the contents and the file names take the value that I enter as the project name. When I create a new project from the template I see 2 dialog boxes, the first one seems to indicate success, i.e.
The operation completed successfully.
The second one indicate that there was an access violation, i.e.
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
I press the OK button, the new project does not show up. I check the disk and only the project file (vcxproj) has been created, in this case it looks fine, no other files were created.
I checked the vcxproj file and it looks fine.
Other information:
I am using VS 2012
VS was started in administrator mode
The target location is my documents folder
Any idea?
//*eggbox

SolutionName.vcxproj file contains information about additional compiling files. All files which solution must compile must be located under same folder as SolutionName.vcxproj file.
It is very interesting issue which is correlated with next lines of vcxproj file
<ItemGroup>
<ClCompile Include="Example\AdditionCompiledFile.cpp" />
<ClCompile Include="ConsoleApplication1.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='DebugMD|Win32'">Create</PrecompiledHeader>
</ClCompile>
The issue is reproduced on VS 2013 also.

Related

Package name contains unexpecting level com.tmp

My Android Studio application called calendar contains package spectorsky, and it works. However, when I try to save the settings by
SharedPreferences calendarSettings;
calendarSettings = getSharedPreferences("calendarINI", Context.MODE_PRIVATE);
calendarSettings.edit().putLong("TimeZone",Double.doubleToLongBits(Riseset.timezone));
and then seek saved xml via Device File Explorer, I see my package on the strange level `com.tmp.spectorsky.calendar', see printscreen:
My file system on the hard disk does not contain tmp directory anywhere concerning this application. I see that the package names on other examples contain com level (somewhat like com.package.app), but no tmp domain is observed.
So, the question: why tmp level appears in my package name, and can (and should) I get rid it?
Level com.tmp was written it two places: in the manifest file AndroidManifest.xml and in the gradle (right-click on the app in project view, Open Module Settings, ApplicationID). Then, after cleaning the project, wrong com.tmp.... directory can be deleted from the Device File Explorer.

Visual studio export template replaces original projectname with $safeprojectname$

My project is a mvc4 project in visual studio 2013 ultimate.
I tryd to send my project by following the steps :
File > Export template > (leave all the options as default)
I get a zip that i unpack. If i open the unpacked solution and run the program i get alot of errors. It looks like visual studio replaced all the text that contained the projectname with $safeprojectname$. How can i export the project without visual studio replacing all the 'projectname' spots so that i can run my program.
I tryed creating a new project (console application) with no code in it, if i export it and import it i get the same message first i get :
Warning 1 Load of property 'RootNamespace' failed. The string for the root namespace must be a valid identifier. SvenEind
and after running i get
190 errors 31 warnings
I tryd importing http://www.asp.net/mvc/tutorials/getting-started-with-ef-5-using-mvc-4/building-the-ef5-mvc4-chapter-downloads and that worked for me.
So i guess the problem is in some kind of settings for exporting files.
replaced all the text that contained the projectname with $safeprojectname$
This is very much by design. You created a project template, a cookie-cutter for new projects. You are not supposed to do anything with the .zip archive. It should sit patiently in your "My Exported Templates" folder. Until the day arrives that you want to start a new project.
You then can pick the template instead of using one of the built-in ones that were preinstalled by the Visual Studio installer. Visual Studio prompts you for the project name. It then unzips the archive, copying the files into your new project directory. And modifies the files, $safeprojectname$ is substituted by the new project name you entered. You now have a good start for your new project, using the settings and assets that you saved earlier when you created the template.
Sounds like you had an entirely different use in mind, I can't guess at the intention from the question.
Hmmm. I got this error on Build:
The app manifest must be valid as per schema: Line 42, Column 18, Reason: '$safeprojectname$' violates pattern constraint of '([A-Za-z][A-Za-z0-9]*)(\.[A-Za-z][A-Za-z0-9]*)*'. The attribute 'Id' with value '$safeprojectname$' failed to parse.
So I grabbed the project name from the VS Configuration Manger and put it in the app manifest like this.
<Applications>
<Application
Id="CordovaApp.Windows10"
And the error went away and the project built. HTH.

Two output file names resolved to the same output path

I have a project in VS2013, where I use the report from Telerik.
In the solution I have one report and a few classes. If I copy the first report rename it, Visual Studio reports error:
Two output file names resolved to the same output path: "obj\Debug\...
If I Remove the copied report and try to through the wizard add a new report to project, VS report me the same error.
Do you have someone with experience and someone you do not know the solution?
Thank you
I got this error when using entity frameworks code first migrations and had the same name for two of my migrations in the Migrations folder.
Two output file names resolved to the same output path: "obj\Debug\***.resources
I deleted the duplicate migration.cs file and the error went away. running add-migration again with the same name brought it back.
I had three files for a userControl, all sharing a common partial class, and this caused my issue; they were named ucPlate.cs, ucPlate.Map.cs, and ucPlate.Graphics.cs. When I changed ucPlate.Graphics userControl surface to DoubleBuffered, I got the compilation error, "Error 21 Two output file names resolved to the same output path: "obj\Debug\ASMS.Controls.ucPlate.resources" Reverting to DoubleBuffered = false did not fix it, nor did deleting the .resx file that was created when I turned on DoubleBuffered (previously, there was no .resx file).
The root cause was that turning on DoubleBuffered in the subsidiary partial class file auto-added InitializeComponent() to the bottom of my code for that file. This method indicated the duplicate ucPlate name, forcing a .resx creation that already existed for the ucPlate.cs file. I had expected it to be ucPlate.Graphics.resx.
private void InitializeComponent()
{
this.SuspendLayout();
//
// ucPlate
//
this.Name = "ucPlate";
this.ResumeLayout(false);
}
go to the solution explorer (if you rename a form e try to look at your error and delete the .resx file that have in your error)

An unhandled exception of type 'System.IO.IOException' occurred in PresentationFramework.dll

Application is unable to load ANY xaml. Nor create empty window "var abc = new Window1();"
Error message is still the same:
An exception of type 'System.IO.IOException' occurred in PresentationFramework.dll but was not handled in user code
Additional information: Cannot locate resource 'wvmlog.xaml'. (for wvmlog.xaml)
Exception occur on InitializeComponent();
These objects are created without error on another PC - so problem is not in Project settings.
Do not help:
reinstall VS
new install of VS
reinstal .net frameworks
undo source from TFS
complete new workspace and load from TFS
visual studio Clean colution
find and delete all cached dll, pbd
remove all obj directories in solution
install and use VS 2010, VS 2012, VS 2013
move VS and solution into another hard drive
Do Help:
Copy of project (help for 1-2 days, then problem appear again without any manipulation with xaml)
Change solution configuration from 'Debug' to 'Release' (help for 1-2 days, then problem appear in Release configuration without any manipulation with xaml)
Problem is at one PC with Win 7, 64-bit.
The problem occur suddenly after some xaml window renaming, but these changes was many times undo-ed, but problem remain.
Maybe some OS damage, or some wpf/.net caches?
Why wpf/.net show such error on project which is compiled without error - so compiler KNOW that these resources does exist?
Any help is appreciated.
I had this very same issue.
What design pattern are you using?
The issue I had was when I changed the output window ie created a new one and deleted the old one.
I am using MVVM so I created the window in the View folder.
If this is your issue, your APP.XAML will look like:
<Application x:Class="dotDiff2013.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
You then change the startURI to wherever your new window is stored. ie in the view folder.
StartupUri="Main/MainWindow.xaml"
This helped for me. Hope it's the solver to your problem.

publishing MVC 4 app exception.., The specified path, file name, or both are too long

I am attempting to publish a website, using the file system method. I used this method with visual studio 2010 and I didn't run into to many problems. But I recieved the above error when trying in visual studio 2012. The full error is bellow...
Error : Copying file Service References\ACOServiceReference\FocusedReadMissionsRedux.ACOServiceReference.searchPatientbyDemographicsResponse.datasource to obj\Release\Package\PackageTmp\Service References\ACOServiceReference\FocusedReadMissionsRedux.ACOServiceReference.searchPatientbyDemographicsResponse.datasource failed. The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
What am I missing or doing wrong? Obviously a file path is too long, but is there a way I can create like path variables or something to shorten the path names? How can I set that up?
No you can't shorten it as Windows will use the fully qualified name (C:\aaa\aaa...).
Two solutions:
Shorten your namespace (FocusedReadMissionsRedux.ACOServiceReference.searchPatientbyDemographicsResponse.datasource)
Change the location of your project (ie D:\Code\ProjectOne)
I was able to solve this problem on my project by navigating to the files under the service reference then under Reference.svcmap. Select each one of them and change the build action from Content to none. These files aren't usually needed for the app so they don't need to be published.

Resources